As used in this subsection, the term "substantial improvement" shall mean any repair, reconstruction or improvement of a structure, the cost of which equals or exceeds 50% of the market value based on current assessment of the structure either before the improvement or repair is started or if the structure has been damaged and is being restored, before the damage occurred. For the purposes of this definition, "substantial improvement" is considered to occur when the first alteration of any wall, ceiling, floor, or other structural part of the building commences, whether or not that alteration affects the external dimensions of the structure. The term does not, however, include either:
(a)
Any project for improvement of a structure to comply with existing state or local health, sanitary or safety code specifications which is solely necessary to assure safe living conditions.
(b)
Any alteration of a structure listed on the National Register of Historic Places or a state inventory of historic places.