Any time you almost sleep with a girl... then don't... it's usually done. Best call to make when that happens is have zero contact with her until it's time to set up another meet, and if she won't come out walk away.
You've made yourself pretty valuable to her life in the meantime as a friend and texting partner. Coupled with the fact that the escalation failed, you're probably friend zoned. Still, meet up with her, try and take her to bed, and see what happens. If it doesn't work this time I'd suggest you walk away before you get caught up investing more time in the girl, though, and just make sure you close things out with the next girl.
I haven't had many failed escalations in some time, but when I do, I never contact the girl again after anymore. Failed mating typically results in an automatic write-off from the girl, and it's best (for your own sake) if you start viewing it that way, too (otherwise you can waste a LOT of time on girls who've written you off as a mate but still want you as a friend / supporter because you feel like you were oh-so-close).