Hi,
Just a thought and question:
Are you sure that it is the PIC that stops? I've never used the MCS Debugger but is it possible that IT is either stopping itself (so that you THINK the program has stopped) or perhaps IT is actually stopping the PIC? Have you tried running it without the ICD?

And, what others have said: ALL subroutines to which you jump with a GOSUB must, at some point, end with a RETURN or bad things will happen. I haven't looked that close at your code but perhaps you've just been "lucky" that it works and that after three minutes there's been exactly the amount of GOSUBS without RETURN to make the stack tip over. I don't know, just thinking out loud.

/Henrik.