It seems conditional comments have always created issues across the versions. I reported it in 2010
http://blogengine.codeplex.com/discussions/223762. When I upgraded to the latest 2.7, I noticed BE injected its JS scripts inside one of the conditional comments in my theme which was a problem.
The page's header controls collection doesn't seem to be correct when there are conditional comments in the page.
I am not sure why BE is trying to find out where to inject the JS. So what I did in the AddGlobalScriptsToThePage method is comment out the GetIndex call and use 'int idx = 0;' instead. This way BE's JS scripts are at the top of the head tag. This works
for me because I want jQuery to load before all the other scripts which depend on it.