(b) If such voluntary resident gives notice in writing to the director of the resident's desire to leave the school, the director shall promptly release the resident; provided, however, that if there are reasonable grounds for belief that the resident may be in need of involuntary care and treatment, the director may retain the resident for a period not to exceed seventy-two hours from receipt of such notice. Before the expiration of such seventy-two hour period, the director shall either release the resident or apply to a court of record in the county where the school is located for an order authorizing the involuntary retention of such resident. The application and proceedings in connection therewith shall be in the manner prescribed in this article for a court authorization to retain an involuntary resident, except that notice of such application shall be served forthwith and, if a hearing be demanded, the date for hearing to be fixed by the court shall be at a time not later than three days from the date such notice has been received by the court. If it be determined by the court that the resident has a developmental disability and is in need of retention for involuntary care and treatment in the school, the court shall forthwith issue an order authorizing the retention of such resident for care and treatment in the school, or, if requested by the resident, his guardian, or committee, such other non-public school as may be within the financial means of the resident, for a period not exceeding sixty days from the date of such order. Further applications for retention of the resident for periods not exceeding one year, and successive two year periods thereafter, respectively, may thereafter be made in accordance with the provisions of this article. In the case of a resident under eighteen years of age, such notice requesting release of the resident may be given by the resident, by the person who made application for his admission, by a person of equal or closer relationship to the resident, or by the mental hygiene legal service. If such notice be given by any other person, the director may in his discretion refuse to discharge the resident and, in the event of such refusal, such other person or the mental hygiene legal service may apply to the supreme court or to a county court for the release of the resident.