You can use a Clean Markup widget in the Debug position to put the code in your site, but it will be at the end of the body, rather than the beginning.
The other option would be to edit the index.php file in the theme folder and just put the code there manually. The index.php file isn't touched by the
Vertex Upgrade Patch, so the change should stay even in future updates.