I suggest investigating the reason why the scripts do not end successfully. It's possible the scripts should upgraded or modified to ensure the processes do not hang. Otherwise, you may want to consider using a process resource manager to automatically kill certain processes that run over a set period of time.
Sorry, been away so only just read your reply.
The usual problem is that unlike all other programmers, I don't write perfect code every time and during dev. I occasionally create an endless loop. It only takes one of these for the server to throw it's toys out of the pram. I thought there may be a setting somewhere on the server to limit the time a script can run.
Not having a time limit is useful sometimes but can also come back to bite you.