During any proceeding to determine whether to release a person with mental illness, serious emotional disturbance, or intellectual disability seeking release by means of a writ of habeas corpus under this part or § 33-3-101, or otherwise, the court shall also, if the issue is raised in the responsive pleading, determine whether the person seeking release presently has mental illness, serious emotional disturbance, or intellectual disability and meets the standards for involuntary commitment under chapter 6, part 5 of this title, or §§ 33-5-402 and 33-5-403.