An environment variable is not meant to do such a trick. The script inherits the environment as a copy once it is run; the two environments are then independent.
You may need to look for interprocess communication methods. If you really, really have to do this via variable, check thisthis; although it's not the right way to communicate with a running process in normal usage.