You could also use the template hooks for this (so you wouldn't need to change the templates in every style you have, and you wouldn't need to edit them again, after a upgrade where it was necessary to revert the templates..)
You can use template hook: page_container_head to add something before the </head> tag
And template hook body or page_container_js_body can be used to add something before the </body>