(Disclaimer: This is just my idea/example of how it could work. If you like the idea, but not the example, then say so, rather then critisizing the idea and example.)
(Also, remember, in the following example, the exampled bot was dealt damage that would, in the current system, kill him instantly.)
Every 0.1% energy and 0.2% body lost in a single adds 1 to a shock variable (which can be read via .shock, to allow some bots to have mild defenses against it to prevent death.)
This means if you lose half your energy and a tenth of your body (ouch!) in a single cycle, your shock becomes 550. That, however, is far from the worst of it.
For every quarter of your energy, or half of your body that's lost (basically, every 250 shock you gain), the gain doubles. (I'm sure it's not that hard to figure out how to do this without making an infinite loop. :P )
So that means you just got a painful 2200 shock.
But it's only temporary, luckily! Every cycle, you lose 20% of your current shock, as well as an additional 1 per 20 energy gained (though this doesn't count if you've lost energy). So that'd go from 2200 to 1760. Then down again to 1408. Then 1126. And so on, until it's all gone. (That is, assuming you didn't gain any energy.)
Unfortunately, each cycle you recover from shock, you gain some permanent waste to simulate permanent damage. Probably 0.2*(Shock/100).
(In the above example, it'd take 31 cycles to completely recover. But you'd be back to normal in about 4-6 cycles. Unless you had a major amount of waste/permanent waste built up.) (Note, that also acts as if you didn't gain any energy.)
(As yet another note, you'd estimatingly gain around 21.73 permanent waste.)