
OK, so I just wasted some hours finding a weird bug and it's workaround, which I am documenting here so that others might be able to google the solution. My .js scripts started generating an error message Your scripts are currently disabled due to an error that was detected. Please make appropriate changes to your scripts and click the "Save Script" button and we'll attempt to start running them again. More info...
For reference, the error message generated was: SyntaxError: Illegal return statement
So I started deleting routines one by one, starting with the most recently updated, then starting at the top and eventually doing all of them . It did not go away until I deleted the line that said }); // End ON Chat:message. Which was the very last line of 5600 line file! Further experimentation found that if I delete the comment, but leave the brace, paren, semi-colon. Or if I leave everything, but put at least one blank line after it, everything is OK. It is only when the very last line has a // comment on it that you get the "Illegal return statement" error. So make sure you always have a blank line as the last line of your .js file. I had years previously found that if the first character of your .js file was not a space, you also have problems.