OPAL-1494: Refresh variable when changing the script on a copy...

Lots of noise because I've "Reformatted" the code but the only functionnality change starts at line 571.

If the save was successfull, we refetch the variable before closing the popup window. The method close() is always called i.e. does not depend on the status of the callback.