My reading of 19.2-8 pertaining to prosecution of violations of 36-106 is that the statute does not commence until the building official approves the work, thus becoming aware of initial use / occupancy or the issuance of a certificate (see USBC 113.8 for use / occupancy and 116.1 for certificates). The two year discovery period is not likely possible for most illegal work and the statute wasn’t enacted to protect those who circumvent applicable regulations.