Hi,
Examining the RCON register may give some clue to why the device resets, if it's the watchdog for example. The manual doesn't say anything about a limitation on the number of nested WHILE-WEND loops.
You need to figure out where in the code "you are" when it crashes and/or if it has anything to do with the "depth" of the menu structure or if it's completely "random". Double and tripplecheck that you always end up at a RETURN when you've GOSUBed to some place.

If you have a serial connection then adding a boatload of HSEROUT statements is another way to keep track of what's happening. Entering menu, level 2, level 3, setting 2, level 2 etc. If you're using MPLAB and have a PICKit3 or other device programmer/debugger then you might give source level debugging a shot. Unfortunately it's not supported in the MicroCodeStudio IDE.

/Henrik.