Step one: STOP thinking that every guy deserves better than you. By thinking this way, it is the first step towards reverting RIGHT BACK to where you were. I mean, really - your insecurities are what often lead someone to step all over you. Just... Stop. I don't know you personally, though I feel like I know a good portion of your life's story from simply reading this board (and believe me, I have - I just prefer to lurk, generally) and you shouldn't go back to the way things were. If you truly want to change, this is where you start. Stop saying and thinking things like that.
Step two: Take it slow. Just because he's looking at you and doing things that you perceive as flirting doesn't mean he is. He very well might be, but, especially because there is another girl involved, let him work it out. It shouldn't be of any concern to you at this point in time. Until he confides in you something or leaves her, let it be. I guess stay alert, but... Let it be. You say you're not ready for a relationship, then don't even think about it. When it needs to happen, when it's the appropriate time and the right person comes along, it will happen.
Just because he makes you laugh and smile doesn't mean it's worthy of an official relationship. Get a feel for him (not, you know, literally/physically) and his personality as much as possible before moving into something. Don't kid yourself on what is bad about him, either - he may make you smile, but evaluate everything. Honestly, when you find yourself ready, you'll know. Often it'll just sort of fall into you lap long after you've become content with just being by yourself. Sometimes it's a long process, tedious even, but it's NECESSARY.
Step three: If he asks you out, and you still feel like you're not ready, for fuck's sake, be HONEST with him. If you're not ready (which, personally, from what I've read, I don't think you will be for a while - you need time to relax and learn to stand on your own two feet. Can someone else help you with that? Sure, in a restricted sort of way, but how are you supposed to learn to be independent when you're attached to someone all the time?) you'll just seem as needy and wanting as she does to you. If it's just a date and you feel comfortable with that, go. Let him know, though, that you're not ready for anything serious yet. For that matter, be honest with yourself about your feelings. Don't pressure yourself or let him pressure you into it.
Step four: Think about if you really want to be in a relationship with someone who may have just broken up with their girlfriend (perhaps, even, an ugly breakup) and if she's going to be around, how that'll effect your feelings. Girls create a lot of useless, unnecessary, snippy drama (Believe me, I should know, I am one) and I'm sure that she'd be no different. This sort of goes back to the 'take it slow' step.
Realize that you need time and, if he's such a great guy and genuinely likes you, I'd say that he'd probably wait around and give you the space you need. If he does wait around, don't be too eager to spill your heart out to him - just because he waited doesn't mean it's going to last forever. Take it easy, take it slow. Don't feel the need, either, to divulge exactly why unless you feel comfortable telling him so. If he doesn't feel like waiting around, he wasn't that great of a guy, I guess - Either it'll happen with him when the time is right or someone else, better, will come along. Don't be afraid of 'loss' - especially of something you don't actually have yet.
tl;dr -
Just wait. See what happens. Take it slow. BE HONEST - both with him AND yourself. Make sure it's what you want.
Oh, and don't jump on the 'I love you' train too quickly either. Feelings are good, but A) You could scare him B) That's a very serious, kind of elusive emotion for a lot of people C) It makes you look eager and desperate D) It puts you in a very hard place emotionally.