I'm not even going to touch adding more complexity to every instance of an Undead being hit.
I'm skipping most of your post because I'm trying to focus on the code and implementation. The choices of when, or under what circumstances, it runs is entirely up to the world builders, and I really have no dog in that fight. So, I don't disagree. It's just not something I have an opinion on.
This last line, however, is very much about the code, and a very important consideration.
OnDamaged runs every time a creature takes damage. A character fighting an enemy of a proper CR for his level typically won't land every attack. However, high level melee classes will still land multiple damaging blows per round. On a server that regularly reaches 100 active players and a huge number of dungeons, Keeping OnDamaged lightweight becomes critical.
OnDeath typically runs once in each creatures (un)life, and tends to be a heavier script since it runs so rarely. It already handles all of the spawning/despawning of corpses/lootbags, treasure drop calculations, etc. Most of the points I'll make for my OnDamaged code remain true of my OnDeath code. Given that and the fact that my code cancels the rest of the script when it runs (Didn't die), I'm going to stick to just the OnHit.
So, I'm going to give my analysis on the performance hit of the code given some possible usage cases.
If they were to paste in the code as it stands now (Affects all forms of negative damage)(Extremely unlikely)
When a creature takes damage, it checks to see if they are undead (They might already have this check running. If so, this is free.). Checking the state of a true/false boolean is one of the fastest things the engine can do. Typical AI scripts can run hundreds of this kind of check on every creature on the server every round. If this returns false (Not undead), then it's safe to say that the snippet will have effectively no effect on performance.
Next, we check for the amount of negative damage inflicted. This is also a very fast check, as it's just retrieving variables. In the background, however, it has to retrieve the value for each damage type of the attack that just hit us, and then add all the negative sources together. I would estimate that this check is roughly equivalent to running the GetRacialType check about 15 times. So, its effect isn't 0. However, it's still quite fast. As long as the damaged returned is 0, the impact on the server probably wouldn't be noticeable. This is where the developers would add their own checks if they wanted to limit the script to only affect certain sources of damage.
Only if we made it this far, then we run the more expensive code. The main body of the code has to construct an effect and apply it. While not the slowest operation, it does take a measurable amount of time. Most AI scripts try to limit using this more than 3 or 4 times in a single round. Most spells use this multiple times in their code. Fireball has to apply the visual effect and the damage effect to every creature in its radius at the same time, for instance. So, it can be used safely as long as it's not abused. This code uses a single effect, so it should be safe as long as there isn't an unusually large number of undead taking negative damage at the same time. If (Server wide) a total of 20 negative damage causing events happened to undead every round for several rounds, you would likely be able to see a barely noticeable lag from my code. While I believe 20 fairly specific damaging events of this type in a single round, repeatedly, are going to be very rare, I won't say that it couldn't happen.
If, however, they alter my snippet to check for people causing damage with a negative energy shield, as per my suggestion, then you would need undead successfully damaging someone with an active damaging shield 20 times per round for a few rounds straight to see any effect. While characters might make the mistake of casting Death armor before an undead fight once, I doubt such shields would be a common practice in undead dungeons. I am confident that there would never be any noticeable effect if the devs decide to only use my code snippet to make specific changes to the specific effects that they might want to control.
I can't imagine them actually wanting to reverse every unscripted source of Negative Damage. It would change the balance of the entire server. So, I stand behind my code as essentially lag free.