Ok. So to do what I am trying to do, here is what needs to be done:
In the globalPage script you can place this code in there:
----------------------
$PAGETEXT := $PAGETEXT + "
<script>
function testme(){
document.write('Hello World!!');
}
testme();
</script>"
------------------------------------------
Basically this can act as a stand-in for any of the more complex behavior that you want to run.
So for everyone who offered advice and encouragement on this thread: Thank you.