I suggest you simplify your problem by using a state machine architecture. Yes you can perform recursive calls but I don't think it is necessary for this example. Check out my example. Hope this helps.
BJD1613
Lead Test Tools Development Engineer
Philips Respironics
Certified LV Architect / Instructor