Section 9. In an action of summary process to recover possession of premises occupied for dwelling purposes, other than a room in a hotel, or a dwelling unit in a lodging house or rooming house wherein the occupant has maintained such occupancy for less than three consecutive months, where a tenancy has been terminated without fault of the tenant, either by operation of law or by act of the landlord, except by a notice to quit for nonpayment of rent as provided in section twelve of chapter one hundred and eighty-six, a stay or stays of judgment and execution may be granted, as hereinafter provided, for a period not exceeding six months or for periods not exceeding six months in the aggregate, or, for a period not exceeding twelve months or for periods not exceeding twelve months in the aggregate in the case of premises occupied by a handicapped person or an individual sixty years of age or older, as the court may deem just and reasonable, upon application of the tenant or the surviving spouse, parent or child of a deceased tenant if such spouse, parent or child occupied said premises for dwelling purposes at the time when said tenancy was terminated and such occupancy was not in violation of the terms of the tenancy; provided, however, that a stay or stays of judgment and execution in the case of premises occupied by an employee of a farmer conditioned upon his employment by such farmer and which employment has been legally terminated shall not be granted for a period exceeding two months or for periods exceeding two months in the aggregate. For the purpose of this section, the words ''handicapped person'' shall mean a person who:
(a) has a physical or mental impairment which substantially limits such person's ability to care for himself, perform manual tasks, walk, see, hear, speak, breathe, learn or work; or
(b) has a physical or mental impairment which significantly limits the housing appropriate for such person or which significantly limits such person's ability to seek new housing; or
(c) would be eligible for housing for handicapped persons under the provisions of chapter one hundred and twenty-one B.