Re: residentural electrical
No matter how the local laws read, it is difficult legally to prevent a residential property owner from making unpermitted improvements on their principal residence. Such property rights are well-documented in Common case law. (Of course with the recent Supreme Court decision on eminent domain that could change ? who knows?)
This is not to say there are no enforcement tools at all, of course. The primary legal one is denial of transfer of ownership until all applicable codes are met. This is based on the principle that a property owner is ALWAYS responsible for the safety of others on his or her property. It is disposal of property before or after the fact to avoid this responsibility is that is illegal. This principle is also why ?poachers guns? are illegal and thieves and burglars have occasionally successfully sued property owners for injuries.
A property owner may seek indemnification through insurance or other contracted (read licensed contractor) means. This is the second major way of enforcement. Buried somewhere in the text of most insurance policies, will be a disclaimer that damages resulting from non-compliant property modifications are not covered. However, if the damages resulted from non-compliant modifications made by a licensed contractor, the insurance company will generally cover them and seek to recover from the contractor, if possible.
The last means is also indirect. A jurisdiction may still attempt to enforce what is technically unenforceable and the property owner may simply decide it isn?t worth the cost of fighting it. This is the most common enforcement method ? and it is legal until a property owner successfully challenges it within a given jurisdiction. At that point, the jurisdiction must abandon that particular form of enforcement or rewrite its statutes.
Disclaimer: This is not a legal opinion, of course; just my observation of many and varied successful actions of both enforcement and challenges over the years.