And if you have a script that is "hanging", then having a timer built into the script would not do any good as it would be "hung" as well.

Best is to find out what is causing the issue as others have stated and then deal with that issue.
_________________________
Today is the tomorrow you worried about yesterday.