I was having an affair with a co worker for over 18 months. We ended the relationship and became hostile with each other. I wrote her up on a verbal abuse charge and she retaliated with charges of sexual harassment. The points she bought up were the fun times we had together. She turned them around and accused me of inviting the sexual behaviors which she claims she was never a part of. I have been fired and labeled as a stalker. She denies a relationship ever happened. She used our sexually explicit texts and made it one sided for the management to assume I was chasing after her. The company never showed me the texts or asked me to provide proof with my texts. She has spread rumors around the company of how I was stalking her. I have lost everything to false claims.
You've raised a number of issues. With respect to the company where you worked, you could certainly file an employment complaint and claim that you were wrongfully terminated for sexual harassment that never occurred. This might be more difficult, however, if you were an at-will employee, or if the company has a strict no-dating policy (as I suspect, given that no one else in your company seems to know about your 18-month relationship.)
From what you've said, it sounds like you have a considerably stronger defamation claim. You could probably sue both your former co-worker/girlfriend and the company. A victory there wouldn't get you your job back, but it might help remove some of the stigma you are feeling now and, also, pay some bills until you get back on your feet.
I obviously cannot advise you about PA employment law, however, the picture you paint , strongy suggests the need for at least a consultation with an employment / labor attorney. Not saying that you are in the clear either as there is the question about the post breakup writeup.