Call me a cynic, but...
- Some building codes make sense. Some are just braindead stupid. Most, frankly, are arbitrary: varying from town to town, as often as not put into place by local building companies through friendly local politicians, trying to secure some competitive advantage. There's nothing particular special about them, and they can and should be taken with a large grain of common sense.
- Government inspections are graft: a way for the local government to levy yet another useless fee. In too many cases, the inspection is passed when the inspector finds the envelope with the money. Or maybe the general contractor is his drinking buddy. No home buyer should trust a government inspection to mean anything.
- Anyone buying a house *must* have it inspected by their own inspector. Even if the house is brand new (see the previous point). For an older home, you never know what has happened during the life of the building. On top of that, inspect the house yourself. Trust-but-verify.
- Finally, there's nothing particularly complicated about most construction work. Some of it is heavy work. some of it takes a bit of practice (plastering, gack). In most cases, the single most important point is using the right materials. Doing work yourself, you are likely to overspec. materials, whereas contractors often try to get away with the absolute minimum. The end result from a competent "amateur" may well be better than work by a professional. Then, if you have no choice, you can pay a licensed contractor to check your work and get the inspection done.
I have seen claptrap houses that passed inspection. The realtor didn't understand why I ran screaming. I have seen solid, well-built structures that failed, and failed, and failed until that magic envelope appeared.