Dimsaver isn't my code, so i'm not sure if this is the right way to do it, but maybe you could solve your problem like this:
On line 14, replace
dragx = 15
dragy = 15
As far as i understand, that'll configure dimsaver so that the mouse has to be moved more than 15 pixels from it's original place to deactivate it.
I do like your idea about being able to close windows and keep dimsaver active, but that'd be a major rewirte of the code, and i'm not up to the job. I just hope this'll solve the problem.