What you can do to fix this is too set your last nested while loop, the loop that checks if the unit is idle, in a new action. And flag the option Create Thread i the new action. Like this:
YOUR NEW ACTION:
Don't know what the precise problem is with your map, but I had that ones. I launched trigger debugger, and it appeared i divided by zero :P
Still have some spare time? ^_^
I have a question: Can you change the command card submenu with a trigger?
And if not: What is the best way to make a dialog based shop, with multiple menus?
Thanks in advance :)