(a) Alterations, repairs or rehabilitation work may be made to any existing structure, building, electrical, gas, mechanical or plumbing system without requiring the building, structure, plumbing, electrical, mechanical or gas system to comply with all the requirements of the technical codes provided that the alteration, repair or rehabilitation work conforms to the requirements of the technical codes for new construction. The building official shall determine the extent to which the existing system shall be made to conform to the requirements of the technical codes for new construction. If such work exceeds 50 percent of market value of the building then said building shall be brought to current codes. (b) If the occupancy classification of any existing building or structure is changed, the building, electrical, gas, mechanical and plumbing systems shall be made to conform to the intent of the technical codes as required by the building official.