It's not quite accurate to say that the scratch program itself is being uploaded to the gamepad. More accurately, a set of leg motions programmed using scratch is being recorded to the gamepad and can be later triggered using gamepad buttons. (The difference is subtle, but for example you can't really incorporate sensors into the gamepad recordings.) Still, this is a powerful feature that allows for some very cool projects.
In order to put leg motions created in scratch onto the gamepad you need to incorporate the scratch RECORD START and RECORD END blocks into your program.
The RECORD START block allows you to select what button sequence will trigger the given leg motions. For example you can select W1 and "forward". In this case, a long click on W1 (a click that lasts at least half a second) followed by pressing the "forward" DPAD button on the right (the button that would normally make the robot walk forward, top of the diamond shaped block of DPAD buttons). After that, your custom leg motion will be triggered and will play repeatdly until you release the "forward" button.
The RECORD END block should be at the end of the set of motions you're programming.
A complete example of how this is done is shown in our "hello world" example here:
Yes, I know our scratch guide needs a lot more examples ... this is something we're still working on. It's enough to get people who have some experience up and running but for beginners we need a bunch more examples.
Hope this helps,