It is perfectly ok to place the <script>
tag anywhere in the body of the document.
From here,
The SCRIPT element places a script within a document. This element may appear any number of times in the HEAD or BODY of an HTML document.
However, whenever a <script>
tag occurs, it pauses the parsing of the code till the script gets loaded, and executed.