Section 149D. Upon the payment of such unclaimed funds to the state treasurer, the commonwealth shall assume, for the benefit of those entitled to receive the same and for the safety of the moneys so paid, the custody of such unclaimed funds, and the insurer making such payment shall immediately and thereafter be relieved of and held harmless by the commonwealth from any and all liability for any claim or claims which exist at such time with reference to such unclaimed funds or which may thereafter be made or may come into existence on account of or in respect to any such unclaimed funds. All money paid into the state treasury shall be credited to the General Fund. Any person may, however, establish his claim for money paid to the state treasurer under the provisions of sections one hundred and forty-nine A to one hundred and forty-nine D, inclusive, and any claim so established to the satisfaction of the attorney general shall be paid from funds appropriated for the purpose. In the event legal proceedings are instituted against the insurance company by another state with respect to the unclaimed funds paid to the state treasurer, the insurance company shall notify the attorney general of the commonwealth of such proceedings and the attorney general may, in his discretion, intervene therein. If after the insurance company has actively defended, a judgment in such proceedings is entered against the insurance company for any amount paid to the state treasurer hereunder, the state treasurer shall, upon being furnished with proof of payment in satisfaction of said judgment, immediately reimburse the insurance company the amount so paid to the state treasurer.