George:
Some cities/twp's etc., here in NJ have a CCO (Continued Certificate of Occupancy) requirement; it applies to commercial and residential properties in most locales. At or before the change in ownership/occupancy an inspection is required. Electric, Plumbing, Fire, Building, Etc. A fee is charged for the CCO application. The inspections are non-invasive, visual. Any blatant violations are cited and required to be repaired. Yes, the repairs have to be "Permitted" and inspected. Repairs can be made by the homeowner, or a contractor, but a Permit is required.
Further details of this can be discussed here or by e-mail.
John