Not really a bug, because the value is written in the script itself. So every time the script is overwritten (updated) the values are reset.
The way the variables are saved would have to be changed. But I think that wouldn't be a good idea because if the use of the variable changes in an update, the script could get unusable after the update if an old no longer valid value would be used.