A team that I am working on has gotten into the habit of using tags in random places in the body of our HTML pages. For example:
It's certainly legal; I've seen it on a few pages here on Exforsys for example.
Now this is a tutorial site showing the basics of HTML and JavaScript so in that context it's perfectly understandable. However, I wouldn't like to see it in production code for anything more than a simple statement or two. Without seeing what you've replaced by // Some JavaScript code here I wouldn't like to comment.
There shouldn't be any browser issues with this though.