There is a big difference between a script going into a loop or waiting upon a server on the Web. Normally it is the second case which causes "Script not responding" errors.
Firefox has got no way of knowing the difference between a Web server not responding or just being slow. So it has a couple of dumb guillotine-type cut-off mechanisms like dom.max_script_run_time and dom.max_chrome_script_run_time, which specify how long it is willing to wait before canceling the script and any connection it might be waiting upon at the moment.
These sort of mechanisms are very dangerous to use. For example, while buying an item on the Web, the online payment site may be slow to react, so Firefox will just cancel the script and connection with unknown results as regarding your bank account.