If you see some changes in behavior of the script that might be because of environment issues. Does your script start with assumption of state when it opens the browser, if yes then you need eliminate that and start as fresh like a blank page.
I recommend you inject evaluate javascript action in your script before the start of the script and use functions like
Utils.clearCookies(); Utils.clearCache();
to make your script more reliable and robust so that it works consistenly without any assumptions.
Thanks!