I don't know, thats a pretty tall order there. ( *swish* it went over my head )
Race and gender affects attribute stats, and changing level adjusts those when you select auto-calculate, but I also notice that class affects max-health and other attributes. perhaps has something to do with skills specializing in stealth, magick, or combat?
It's quite different then the way player stats are figured because of multipliers and players choice, endurance affects health gain per level, etc.
I guess someone ( anyone but me

) could go through each race, gender, class, and level, click auto-calculate and input it all into a database/spreadsheet thingy where the formula might be found.

But that doesn't take into account manually edited NPC's, as you already know,
what about placeatme a new instance of the dead npc, getting the maxhealth, and disable/delete it?
just thinking aloud on the keyboard...