First off, consider anything I have posted as suspect as I am a total newby here.
When I was testing the shut_down command, I put it in a loop without the "wait-click 2000" line. It ran but did not shut down *until* I pressed the shutter button to exit the script. THEN it shut down. After thinking about it for a while and looking at a few other commands, I saw somewhere that the wait-click command maybe could be used to give the previous command time to operate. Whether that is true or not, I don't know but as soon as I put that line in the code, it worked.
If I remember right, I also tried just putting shut_down ten times in a row and that did not work either. I'm slowly learning... and it's still fun.