I'm not 100% sure of the exact details (the datasheets, on how the serial boot loader works, would be a good starting place, for you), but I think some microcontrollers, have built in serial downloaders, in their flash or similar.
So if you arrange for your switches/buttons, to (via TTL parallel load shift registers or something), to serially respond/use the serial bootloader (possibly some Atmel MCUs and probably others). You could probably step by step (single step like), gradually enter your initial code into it, and go from there.
N.B. As I said, I'm NOT 100% sure about it, but it might work. The clocking would have to be sorted out, so that the MCU waits for each serial byte to be ready (set on the switches), then programmed in, BYTE by BYTE.