You can use a programming pattern called dependency inversion.
You "inject" the variable you want to influence globally into a function by requiring it in the function
You're now declaring a dependency on that variable for the function to work, and inverting the responsibility to the caller to provide it to you
Then from another file which has access to the variable you want to make avaliable to other scripts, you call that function.
-- stuff with the variable
There are various methods of doing this and this is a very contrived example, but it's a good way of exposing that variable to other scripts without making it global (global state is generally bad)
I'll give you a full example once I get home. If you could give me an example of the scripts involved I can probably work something out for you - just the folder structure and where the variable is/where it needs to be "seen" from.
There's no need for a "collision" system for this.
Given your specific example, you don't need to change a variable to 1/0, I would just recommend that you don't have any variables at all and just respond with functionality. No need to introduce any kind of state here.