Hello gringobomba14,
If you have any extra ports available you could put some code in those empty While Wend loops to light leds to tell you which loop is stalled, or add some serout commands to do the same. or put in an escape counter in the loops.