D.B.
You both are, unfortunately, letting your friendship get in the way of your professionalism, although she is doing it far more than you.
I don't know whether it's her depression, or her insecurity, or her professional jealousy of you (thinking she should have had your position, perhaps because she was there longer), but she's using you for two inappropriate purposes: a) to complain about her job & treatment & lack of advancement, and b) to bypass office policies (which perhaps are not as well detailed as they might be) to get off her desk and be seen in an office (perhaps hoping that management will think she "belongs" there or "looks professional" and therefore should be considered for a promotion.
I think you should NOT respond to her email. If you see her (and you will), I think you should absolutely not say that "it's fine this once" to use your office. I'd keep some distance and say that office access is a management decision. I think you, for your own protection, should contact either HR, or the Operations Manager, or whoever is in charge of the office policies. Say that you are uncomfortable and don't want to get someone in trouble (your friend or the person with the key), but that you are concerned that an employee with no business in your office managed to finagle her way in. That it happened to you means it could happen to someone else, and sensitive information could be on anyone's desk or anyone's computer. That you work in technology makes it even more alarming, because there could be passwords exposed.
If there IS a policy on office access, you must point out that it wasn't followed. If there IS NOT a policy, you might point out that there was possible exposure here and perhaps one should be developed. It's okay to say that you have been friendly with this person outside the office and that your friendship pre-dates your employment with the company (and hers), but that you are not letting your prior relationship get in the way. You have to say outright that this was done without your awareness until after the fact, and you want to know how to respond. If she found something in your office or on your computer, and if she uses it somehow, it's going to come back that you knew about it and, worse, were "okay with it" (at least that's what she'll say).
I think you have to reassess this relationship and decide if it's crossing the line of unprofessionalism. Also, is it benefiting you in any way, or are you just her personal complaint department? Your continued association with someone who violates professional standards and who is on notice could have a negative effect on your employment. And she seems to have little respect for your expertise anyway, since she feels she shoulda/coulda had your job. I know you care about her, but if you are bolstering her past the natural consequences that should befall someone who behaves as she does on the job, I'm not sure it's helping either one of you. You may need to establish some distance.