Honestly, best bet is to contact a laywyer. Why do you think you might get detained? What crime would you commit?
Unless the police finds out right at the scene, I don't think they could really detain you? Even telling a therapist or doctor after an attempt has happened would not necessarily warrant being detained per my understanding.. just tell them you are scared and would not do it again?
or do you mean not wanting to be place under involuntary hold in a hospital/psych ward? It would be likely if you end up having to go to the hospital