The thing with this is.... You are a good person. You're quick to anger sometimes and you can be a bit stubborn ( :) ) but you are basically a lovely woman, who has had some shitty-horrible times and who is doing the very best she can. You want to think the best of some people (certainly not all of them - but people you care about. If he lets you down you (1) legitimately flare up, (2) don't contact - (3) start to recover, (4) stop thinking about him or at least don't think about him so often and then, eventually (5) excuse his behaviour or (6)understand it, because you are a bit daft for him, he's depressed, he needs a friend, he's had a row with his parents, his cousin has died (i know, i'm sorry and i know i sound callous here) and he's been in contact... He drifts back to you and you provide something to him... Comfort, ego stroke, challenge - whatever, I don't know what he gets from you. What do you get from him? Happiness? Comfort? Excitement? Flattery?
He has treated you atrociously. He doesn't deserve to pick up your discarded chewing gum....although the way things are going at the moment I wouldn't be surprised if he started going through your bins.
If you're not getting something positive from this relationship, then please stop engaging, because it will wear you down.