I'm sorry to hear about that, and yes the whole situation really sucks. I agree with what others suggested here, by knowing your rights and asserting them where appropriate and not volunteer too much information. Also, if you are sent to the psych ward, I suppose the best you could do is downplay any suicidal ideation and comply with them just enough to minimally satisfy them so that you will be able to get out sooner than usual.
For the future, I would look into other methods and if you are able to have something sent to you, perhaps having it sent to another location, such as an P.O. Box or something? Also, if attempting CTB, I would suggest doing it away from people you know or family in general, this way you have a much smaller chance of being intervened against.