Local ordinances or regulations governing alterations and repair of existing buildings shall permit the replacement, retention, and extension of original materials and the use of original methods of construction for any building or accessory structure subject to this part, including a hotel, lodginghouse, motel, apartment house, or dwelling, or portions thereof, as long as the portion of the building and structure subject to the replacement, retention, or extension of original materials and the use of original methods of construction complies with the building code provisions governing that portion of the building or accessory structure at the time of construction, and the other rules and regulations of the department or alternative local standards governing that portion at the time of its construction and adopted pursuant to Section 13143.2 and the building or accessory structure does not become or continue to be a substandard building.