Create a level global variable

You can use this suggestion from another post, using spring nodes package.
So you would have something like this.

You might even be able to get away with not putting the boolean for refresh if it’s only going to be used in dynamo player, since it refreshes the script automatically.