Without knowing how/why your scripts are causing you the problem, trying to make a script that will fix it may be difficult because it may just conflict with the other script(s) and not work. And trying to fix your current script would be possible... if you look through and find where the problem is.