Well, the one obvious thought is to put it into a subform and put it into the JSHeader on the subform. That works and is effective, but there's another option that you might want to consider.
That needs to be the format of a src parameter so it's fortunate that you don't need the ?OpenPage to reference that page.
With that "Treat page contents as HTML" enabled, you can go ahead and do whatever formatting you want on the page. For example, you can color-code all you want. I've noticed that the JS Header doesn't color-code the keyword var when it's used to define a variable -- you could make that blue in the page if you want. You could also use different font sizes and styles for different parts of the function if you want. It will all be just passed as plain text (HTML) to the browser.