incident to such sale, shall be applied so far as practicable to the redemption of all such outstanding notes or bonds. If such proceeds are more than sufficient to redeem all such outstanding notes and bonds, one-half of any balance remaining shall be paid over to the state and the remaining one-half of such balance shall be paid over to the authority for payment by it to the municipality in which the project is located. If such proceeds are insufficient for complete redemption of such notes and bonds, any balance remaining after redemption of the largest possible amount thereof shall be paid over to the state. No such sales shall affect the obligation of the authority upon such notes or bonds or the obligation of the state on its guarantee thereof. The proceeds of the sale of any project, or any part thereof, the cost of which was financed, wholly or partially, by a grant, after payment of all necessary expenses incident to such sale, shall first be used for the repayment of such grant to the state.