Also, just a tip: You don't have to keep writing 'waitmovement 1 waitmovement2'. You can replace all instances of those two lines with 'waitmovement 0x0' because the script will wait for both of them to finish. It just makes things a little bit shorter and neater
That's not true, in Ruby at least.
If I use waitmovement 0x0, it'll wait for the applymovement right on top of waitmovement to end before the script continues to execute, even though the other applymovements aren't done moving yet. =/