Comment out all of the sleeps and coroutine.yields.
Replace all of the GcodeExecute calls with GcodeExecuteWait. Another option may be to just create a single string and execute it in exact stop mode.
Look in the API help doc and compare GcodeExecute and GcodeExecuteWait. They have pretty good explanations.
Also, the coroutine.yield. You can't just place it anywhere and expect it to work. It's useless without the rest of the bits that go with it. Where are you creating this coroutine you are yielding? Where are you resuming this coroutine?