if you want to hook to ControllerCommonPage you do it with hk name onControllerCommonPage_InitData, but I suggest alternative approach.
Since you need to add to beginning and end on the body tag, you need to use addScript as suggested earlier to add to head, and add variable hook to common/page.tpl
Check Hooks Template Variables section of the same manual. We still working to improve manuals or waiting for help on that

, so excuse for lack of clarity.
Since there is no variable in core tpl, we can include it in the core distribution, since I think it might be useful. Can you please indicate where exactly you need it?