In Ma, we have two means of holding people, one is section 12 and the other section 35. From what I understood when I was dealing with it, Fl is the only other state that allows sectioning but I can't be sure, that was 3 years ago.
Section 12, a family membet will usually take the person to a hospital for a mental health evaluation but I can tell you from experience, its quite easy to talk ones self out of the sectioning. You basically talk to one shrink and a whatever nurse is assigned to observe you. If they do keep you and they want to keep you linger, they need to either solicit your consent or seek it through the court.
Section 25 can hold someone for 90 days but in reality because of a shortage of beds, its 30 days maximum. Mostly, you complete 32 classes regarding drug and alcohol abuse. You're held in a jail although kept separate. SOme get out in 3 weeks, some are held for more but its more a test on whether you can follow a schedule and not get into fights. Fighting leads to the hole and more importantly missed classes that have to be made up when the class rotation comes back again so it could add way more than the 5 nights in the hole.
It still doesn't work for those who don't want help. And its used way more as a means to get addicts off the street.