Ah good way to see if things need escaping or not is using a timer.
//timer 1 5 echo -a $!duration($idle) | timers
After issuing the /timers, you will see the running timers and their according command.
Basically, you need to distinguish what should be evaluated with the setting of the timer, and what should be evaluated when the timer finishes.
Good luck.