; or (II) with respect to qualified repair or improvement costs, a main residence the value of which does not exceed, on the day before the commencement of the repairs or improvements, 120 percent of the median house price. (ii) Qualified replacement costs The term qualified replacement costs means the costs (including any usual or reasonable settlement, financing, or other closing costs) of replacing— (I) a manufactured home that was manufactured, assembled, or imported for resale before the initial effectiveness of any Federal manufactured home construction and safety standards established pursuant to section 604 of the National Manufactured Housing Construction and Safety Standards Act of 1974 ( 42 U.S.C. 5403 ); or (II) a residence that fails to meet local building codes or is not legally habitable. (iii) Qualified repair or improvement costs The term qualified repair or improvement costs means the costs of making repairs or improvements (including any usual or reasonable financing costs) that will enhance the habitability or long-term value of a residence.