The general rule is effects in beneficial order, but is a Template an effect? Is a Feat an effect? Is it beneficial to apply Human Heritage after Necropoliton (those immunities you crave? results of the undead type it's self, turn/control resistance is fucking useless if you're not undead)? And when or how often can you "change your mind" if two effects are ongoing and the stack order can alter the outcome? These are real questions on the subject, not the crap coming out of your mouth.
That's pretty much the problem.
However, if you are undead while under the effect of Human Heritage, you do keep ALL of the immunities. It says so in the text. It also says you're just a Humanoid for all effects. Even if you do not have the Type Humanoid, the feat says you count as a Humanoid. You're immune to most of the spells that specify Humanoid as a specific, save for Reduce/Enlarge Person, as far as I can tell. Switching around seems like a waste of breath.
I would say that if you have the feat, it overrides your templates/etc. Of course, this is much cleaner with inherited templates and the like. I wonder if there is a way to be a human descended undead before ECL 1.
EDIT: Simply put:
1) You take the feat, your type becomes Humanoid (Human + Whatever), if it was not. You retain any prior traits
2) You take Necropolitan. Your type becomes Undead (Augmented Human + Whatever). Your traits become undead traits.
3) All but the first line of Human Heritage become irrelevant and inoperable. Since your type has changed they have no meaning. You have undead traits.
4) Upon being targeted by an affect, you count as Humanoid with (Human), according to the feat. Effects, such a holy water and control undead, treat you as such.
Fun fact: Dry Lichs who do not count as undead do not suffer in water, since it counts as holy water against them.