Section 53B. Any sums allotted and paid by the commonwealth to a city, town or district as a contribution towards the cost of a useful public works project, the state's share of the cost of which project was financed from the proceeds of a loan issued by such city, town or district, shall be applied towards the payment of such indebtedness.