First up, I think this is probably abusing the delay system in ways it wasn't supposed to be.
But if you want to dig in and have a look, this is where I would start...
I don't think it has anything to do with script recursion (I apologise, I didn't really read the whole thread when I first commented). Instead I'd concentrate on the delay code.
Look in the following places:
You can see that
tele_tick is called from
clockTimer_callback to process the delays, it increments
RATE_CLOCK and that
RATE_CLOCK is defined to be
Surprisingly 10 is the magic number. If I run your initial example with delay time of less than 10 it works, but if it's 10 or more it doesn't, and furthermore the delay icon on the live screen stays lit up. All of this makes me think that there is a bug in the delay code, if we're really unlucky some sort of race condition. :
If you've got an FTDI cable and can solder you could try entertaining yourself with some good ol' fashioned
printf debugging and see if that get's you anywhere.
I'd love to help more, not enough time sadly.