It already happens. It is a 72 hour evaluation. All states have the mechanism in one form or another. While I see the concern over thought crime and abuses, there is a distinction between thought crime and someone who is having a psychiatric episode, a severely altered state of reality or mental disturbance. As far as abuse by the state, that is why the 72 hour limitation is placed on the evaluation. Sometimes the involuntary evaluation is the only solution since the individual is expressing the desire to hurt themselves or someone else, but there is no crime that has been committed.
It should be noted that hospitals and family members seek and obtain these involuntary evaluations at an exponentially higher rate than Law Enforcement.