Project Script Global, when does it run?

I figure this is the case, only run once at the start.

I have existing code that rely on global variables.
These global variables is assigned manually before project is save.

I made a perspective view, so user can set global variable from the view.

I guess the solution is, replace all the code that refer to the global variable to a tag.read command.