Did you trying running this script from a server schedule? Changes made to a global field from a client session are not retained. Changes made to a global field from a host session should be retained--but the changes will not appear on client systems until they clsoe and re-open. Sever scheduled scripts run in a Host context and thus changes to a global field should be retained.
The alternative is to store the value in a non-global field instead of a global one. Often, the values in global fields are actually kept in non-global fields and the global fields are initialized via a start up script when a client opens the file. That way, permanent changes can be made to the global field by changing the non global field from which it is initialized on each start up.