I don't think YOU screwed it up; you can't control feelings he has for someone else. Having been at his beck and call wouldn't have made him yours. In fact, you might have made yourself vulnerable and been really hurt when he confessed his attraction for the ex. You would have felt used if things happened that way. I think it's possible you held back because you sensed something wasn't quite right. Trust your gut.
When you meet someone else more deserving, you will forget him easily! We tend to romanticize past bf's when there is no one else in our lives at the moment. Now that you've beat the Depression ( I hope), you will be open to more relationships in a healthy way.