As long as your global file writes the code to the browser, variables in the global file will function just fine.
e.g., My site runs classic ASP and my JS file is actually a .asp file because I customize the JS based on a few things. So the reference to my JS file looks something like:
My site also uses global files for stuff like global variable settings, navigation functions, etc.
'blah blah - some ASP code here
var someGlobalVariable = 'someValue';
'some more ASP code here if I want it