Answer: The student is subject to the same discipline regarding the threat of violence as any other student would be. Once she is through that process, she can return to school A as her school of origin (assuming that is not against the discipline policy), or enroll in school B. The question would be her best interest. Given the nature of the social media threat, it would appear that returning to school A is not in her best interest. You also said she prefers school B, which weighs heavily in school B’s favor.
Of course it is advisable to provide appropriate mental health supports and other assistance with housing, employment and stability. A school psychologist or mental health provider might want to consider whether an evaluation for special education support is advisable.