(e) The proceeds of any sale of any project, or of any part thereof, the cost of which was financed with a loan or deferred loan by the state to a housing authority, after payment of all necessary expenses incident to such sale, shall be applied to liquidate the outstanding balance of such loan or deferred loan. To this end, the authority shall endorse each purchase money note received by the authority in payment of the purchase price to the order of the state without recourse and shall deliver such note, together with a duly executed assignment of the mortgage securing the same, to the Commissioner of Housing, and the State Treasurer shall credit the face amount of such note as having been paid upon such loan. If the proceeds of the sale of such project or of any part thereof, including as such proceeds the face amount of any purchase money note received by an authority and endorsed and delivered by it to the Commissioner of Housing, as aforesaid, are more than sufficient to liquidate the outstanding balance of such loan, such proceeds shall be applied toward the outstanding balance, if any, on any loan or deferred loan made pursuant to this part on any other project owned and operated by such authority. If any balance remains after all such loans or deferred loans have been liquidated, an amount equal to one-half of any balance remaining shall be retained by or paid over to the state and an amount equal to the remaining one-half of such balance shall be retained by or paid over to the authority for payment by it to the municipality in which the project is located. The proceeds of the sale of any project the cost of which was financed by notes or bonds issued by the authority and guaranteed by the state, or of any part thereof, after payment of all necessary expenses