Most if not all of the code rules currently protect the purchaser of a NEW home from substandard building/wiring/plumbing practices by builders and contractors trying to save a nickle or dime.
The codes don't protect or have anything to do with buying or living in an existing house. You may when purchasing an old home, have the house inspected if your mortgage company requires it, or if you don't know much about houses or systems in a building.
My house when I bought it was a true disaster. I had smoking outlets, circuit breakers that would open from loads at opposite ends of the house. [the front bedroom and the laundry were hooked together, they are about 60' apart]. The kitchen sink drained to a swamp, there were gaps in the fieldstone foundation that a cat could [and did] crawl through. [I found out that the barn cats that came with the place wintered in the basement !]
The old section of the house, as it now stands is pretty good, a vast improvement over what it was. The bath rooms have GFCI circuits, the foundation won't allow stowaways to enter, there is insulation in the attic, and in and on the walls.. most rooms have electricity, etc.
But no code or enforcement 'protected' me from any of the dangers in this place when I bought it.. Now I bought it with full knowledge that it was a dump, and in serious need of a LOT of work. So I'm not complaining, it's just that the current inspectors just don't understand how much the house has already been improved and made safer, I certainly don't need a lecture from the inspector about what 'it needs'.
I just had to zip my lips, and look away when he started in again on 'having to have electricity in that old room'.. the main building inspector quitely said, 'lets cross that bridge later'.. end of lecture. Like I said earlier, the main building inspector had his head set square and level on his shoulders.. common sense and logical thinking abound.
But, I now have those two green stickers.. so I need to get off my rear, away from this computer, and solder up some hot water manifolds for the 2nd floor pex heat circuits..
Merry Christmas !!