I haven't tried anything yet, but you could try making buttons, then make an event that detects which buttons are pushed, corresponds the button pushes with numbers, and puts that data into an array. Then when you press "Run", you have it read the array and perform the commands accordingly. Again, this is an idea, it might work...
I'll try it out later today.
BTW if people are confused. OP is talking about a simple programming game, much like Light Bot