Following a successful surgery, you can expect the Roboroach to respond to stimulus for several hours. The longest I've waited between surgery and experimentation was around 12 hours. After about a day the Roboroach will no longer work (the antenna calcifies around the electrode).
If an electrode breaks off the header during surgery, you can solder it back on, but you will first have to melt the plastic coating off the tip of the wire with a lighter. I find holding it in the flame works best, you can find a heat that melts the plastic but not the silver wire.
Once a surgery has been completed, the electrode is permanently affixed to the cockroach and you can not perform surgery on it again. Once the Roboroach has performed its scientific duty, you can cut its atenas free from the electrodes and release it into the colony (leaving the electrode glued to its head).