I figured out a way to do this. It was the "Paste" command that was messing things up. When I switched to "Type" it worked. Also the Repeat on the arrow keys was glitchy. I had to do single versions of those.
I added a user input at the beginning to keep it configurable. I'm posting it here for any one who wants it