I have almost completely moved away from WYSIWG for probably the same reasons you are having trouble with NVU. In an attempt to make it easy for the "designer" the editor ends up adding extra, and sometimes non-compliant, code to the page.
I would find yourself a good editing program that will auto-highlight code for you and work with that. I don't do a ton of coding, more of a hobby and use a PHP editor that highlights and indents my code for me. I am sure others here will have their own suggestions, but you really need to find what works for you.
Can anybody recomend for me a decent free HTML / WYSISYG website design editor that has the ability to do tasks such as image rollovers, UK English spellcheck etc I am currenly using NVU but find this very limited in what you can do!
Thanks in advance
Dustin

Chowhound
Comic Vine
GameFAQs
GameSpot
Giant Bomb
TechRepublic