Section 20. A state university shall admit as a candidate for a four year degree any person who is a regular member of the police department or fire department of a city or town of the commonwealth within commuting distance of the university, who is recommended by his superior officers and demonstrates sufficient capacity in a competitive admissions examination. A police officer or firefighter who is so admitted shall, while enrolled as a student in good standing at such university, have his tuition paid by the commonwealth. While so enrolled, the city or town by whom he is employed shall pay him his full weekly salary during the thirty-two weeks of each university year; provided, he is enrolled for sixteen semester hours of instruction, works twenty-four hours a week on regular duty as a police officer or firefighter, as the case may be, in said city or town and during university vacation period works his regular weekly tour of duty in his department. Each police officer and firefighter who enrolls at a state university under the provisions of this section shall sign an agreement that he shall remain in full time employment as a police officer or firefighter, as the case may be, in such city or town after he completes such university work for as many years as he has been aided by such city or town under this section.