So, you moved into your fiance and his girlfriend's house earlier this year. Does your boyfriend have his own room? Were he and the girlfriend sharing a room prior to you getting the basement room? If I were her, I'd feel pretty hurt if my boyfriend proposed to his other girlfriend, moved her into our home, and stopped sleeping in our bed (if that is the case).
That being said, I understand your need for privacy and for her to stay out of your room. If you've made that clear to her and she keeps disrespecting that boundary, than I would suggest that you all have a family/household meeting. Ask her how she would feel if you kept stumbling into her room during the night. And if needing access to the router is that important to her, can it be moved up to the first floor where she doesn't need to come into your space to find it.
I do think it is a little cold to say that she should handle her nightmare as an adult would. How exactly does an adult handle a nightmare? I'm 30 years old and I still snuggle up to my husband when I've had a bad dream or if I can't get back to sleep I will hop on Skype and talk to Wendigo. When I was in college, I would call my grandmother. You say that you have anxiety and I understand that her coming into your space makes that worse, but nightmares cause a certain amount of anxiety and I wonder how you'd feel if you were upstairs all alone trying to deal with the panic a nightmare can cause while all the people in the house are down in the basement?
I think you all need to sit down and talk this out. Put a lock on the basement door; the kind used in bathrooms should be fine (so you can get out quickly if necessary); and insist that she knock before entering your space (and vice versa). That way, should she need your boyfriend during the night she can knock to give you two a warning; but that also means that you are expected to answer and not just ignore her.