SetHeader method is only used when Blizzard_ObjectiveTracker add-on is loaded, your function won't be call because your add-on can't be loaded before the Blizzard_ObjectiveTracker.
For secure, you should use hooksecurefunc. Maybe you can test on
Lua Code:
DEFAULT_OBJECTIVE_TRACKER_MODULE:AddObjective