Really sorry to hear that.
Truth is the 'right' thing to do is to run a mile from this girl.
She admits she has feelings for her ex which is a not good, However she has been honest about it, which is good, she could of just strung you too along.
Your best bet, is to leave on good terms, tell her how you feel but stand your ground that you won't be in a triangle with her ex. She will most difficult get with her ex either way by the sounds of things, at least that way you have left on good terms and if the relationship with her ex fails, which is probably will, she will probably come back to you and you could assess it then.
Its really difficult but I rekon even if she picks you over him, she has unresolved feelings for her ex which probably won't go away.
Thanks for the reply. A few more things I feel like adding I'm 25 and she's 24, I have 2 year old little boy and she has a 3 year old little boy(not by the ex in question). We would go out all together on day trips every other Sunday when she wasn't working and she was so happy she even said we were like a little family! I've been messed about before by other girls, but the things she said, the way we kissed, the way she held me, the way we would stare into each others eyes I know she meant it all. So hard how people with BPD can seem to switch these feelings on and off as they please