Section 28A. Any sum or sums which shall be loaned by the mortgagee to the mortgagor at any time after the recording of any mortgage of real estate, to be expended for paying for repairs, improvements, lead paint removal or replacements to, fuel for, or for taxes or other municipal liens, charges or assessments or condominium common expense assessment, including legal fees on, the mortgaged premises, shall be equally secured with and have the same priority as the original indebtedness, to the extent that the aggregate amount outstanding at any one time when added to the balance due on the original indebtedness, shall not exceed the amount originally secured by the mortgage. The provisions of this section shall apply to all forms of mortgages on real estate.
No action under this section shall affect the rights of the holder of any encumbrance which is subject to that of the mortgagee granting the accommodation for the purpose of paying for repairs or replacements to, or for taxes or other municipal liens, charges or assessments on, the mortgaged premises, and recorded prior to September first, nineteen hundred and forty-six, unless his written assent shall be obtained, nor shall any such action affect the rights of an original borrower unless his written assent shall be obtained. In cases where the accommodation is for the purpose of making improvements to the mortgaged premises no action hereunder shall affect the rights of the holder of any encumbrance which is subject to that of the mortgagee granting said accommodation and recorded prior to September first, nineteen hundred and fifty-six, unless his written assent shall be obtained, nor shall any such action affect the rights of an original borrower unless his written assent shall be obtained.