I'm so sorry - what a terrible experience!
I second what others have said - don't hesitate to call 911 or to run back to the store or to yell or scream or do whatever you need to do to make sure he leaves you alone. It is absolutely not your fault.
In the past, we've had some significant problems with very aggressive homeless and panhandlers where I live - I've had one threaten to pull a gun on me. You can bet I went to the nearest store (pre-cell phone days) and called the cops. They now prohibit panhandling after dark, etc. and the cops are pretty good about enforcing it.
I also agree with Nanci's point about bringing the bike into the store. The closest grocery to me has no bike rack and no good place to lock a bike. So I walk around the store with it. I have yet to be bothered (I noted last time I was in there that a bike wheel was sticking out of the break room, so I expect the employees do the same thing).
I would also call the store today and let them know what happened. They will probably be extra vigilent about keeping their store area safe if you tell them what happened - they don't want their customers to have to go through what you did!
Hugs!!!!!
Most days in life don't stand out, But life's about those days that will...