As you've surmised, it's likely a matter of delay time between steps. If the y commands have to be issued very quickly, that could be a problem as well. See if doing the steps manually will work with a second or so between the steps. Also, check the repeat settings on the commands as you may have to shorten or increase them.