Have hope... At least he was kind enough to stay away when you told him to, and you got lessons out of it.
It was your fault too, you might have unconsciously encouraged him, your body language, your expressions might have communicated a signal. You flirted back. To you it was just flirting but he took to next kevel flirting.
You are a woman, capable of falling for a man who does that to you. Remember your lessons and don't let any man do it to you again.
He might have wanted more, but saw your negativity and lack of trust and backed off. That's okay, that's you being you, not you wanting him.
He was at best, a friend. And neither of you want anything out of it anyway. So friends is all you are meant to be but he crosses boundaries. Things happen for a reason. He was sent to help you, teach you, test you, hurt you. Nothing more. Being friends is a bad idea. Especially after everything. Much better to let it go.
You can at least be sure the Universe is looking out for you, by the mere fact that it sent him.
One day, you will end up somewhere, with someone he can't even dream of being, somewhere he will never be able to reach.