I think I messed things up with my friend.....

I have been in love with one of my friends for years! We dated in the past, but I let my overthinking get the better of me and I became super toxic. I wouldn't let him hang out with anyone. I started arguments, it all got so bad he finally broke it off with me. I apologized and he said we could stay friends... He is now engaged to someone who isn't right for him. They have nothing in common at all! She's not really a bad person. She allows him to hang out with me even though I'm an ex, but she is dumber than a box of rocks and they are so different. He's so smart. He was valedictorian. I dont understand what he wants with a dumb girl. He shared the news to me that she was pregnant.... That broke me... I felt awful that I had lost the love of my love. We had been hanging out more recently. He said it's because he knows once the baby gets here they won't have time to hang out with friends so they are both hanging with friends. Since we had been hanging out I felt like he was giving me signs that he wanted to be with me or that he was at least still in love with me.

I wanted to be with him and I knew he still loved me, so I sent him a text at 2am telling him I really needed someone to talk to and I was having bad thoughts. So he drove to see me and I told him how I felt and tried to sleep with me. He pushed me off of him and was mad at me and said that he's with someone and we have been over for a while and that I'm disrespectful. I told him I knew he still loved me and wanted me. I wanted him to want me. I tried to kiss him but he just pushed my face and walked out the door. I've been crying non stop and I think I lost him forever... If I can't have him as a boyfriend again I at least still want our friendship. How can I at the very least save our friendship?