If there is anything anyone can take away from this (and again we are glad you are still here to tell the story) is to at minimum keep windows and doors secured.
I do, however, disagree with much of the self-defense advice given here. There is a difference between self-defense and home defense. Your home is yours and your space which is very different from a public place where you share it with others. The advice about punching, kicking, eye pokes, martial arts, etc. is useful for self-defense on the street where you want to injure the attacker only enough to get him to stop attacking. The reason is you don't want to be hauled off to jail along with the attacker while the courts sort it out.
Home is different. Again, it is yours and your space. A citizen protecting his home is not unlike a king protecting his castle. It is reasonable to assume that if someone is bold enough to force their way in your home that they are there to kill you. In any case they will have to violently attack you if they decide they don't want to leave your home. Almost all 50 states allow deadly force to protect one's home.
Someone said you should just call 911. Nonsense. You will be dead by the time they arrive. Plus, while you are busy talking on the phone you are distracted and giving the criminal more time to come and get you. The first thing you do is either flee or fight. If you decide to fight you get a deadly weapon. That means a gun (preferably) or a knife, ball bat, or similar sharp or heavy object.
Next, someone said "they will just take the gun away from you and use it against you." That is why you don't pick up a weapon to "threaten." You pick it up to use. This is very different from self-defense on the public street. We are talking about your home. It is reasonable for a girl on the sidewalk of a dark street to pull a weapon out of her purse to scare an attacker but not actually use it if she doesn't need to. If they are in your house, your life is automatically in peril. They are going to have to kill you to get your stuff (even if you give it to them they may still kill you) or they will rape you (and probably kill you afterward). They can't take a gun away from you after you have already shot them repeatedly with it.
Most of us don't want to use violence but I'd rather my picture not be put on a poster for this year's Transgender Day of Remembrance. I don't want to see anyone else here "remembered" there either. The goal is to survive not cut deals with criminals. Plus, once they are in your home if they manage not to kill you and get away they may keep coming back and next time bring their friends.
This is why it is crucial, Virginia, to beef up security around your house. Nobody can completely read a criminal's mind. You run off one criminal (which you did) and you may never see him again. Or, he could come back with a gun of his own or a group of his friends. That is why I have a strict policy in Britney's home: Trespassers will be shot (survivors will be shot again).
Anyway, all trans people should learn some martial arts and good self defense for the streets. Especially those of us (such as myself) who go out to the clubs late at night where people can get drunk and stupid. But when it comes to our safety in our homes, we need to be vigilant and we need to mean business. Take care and stay safe. Britney