1. I would have called the police, and treat it as an attempted robery. I'm sure the store has some sort of camra system, so they could get his picture.
2. If I was carrying I would have went for my gun. No stranger comes up to someone carrying a lot of cash and shows off a gun. Assume its a robery, draw, order to the ground, disarm, wait for police.
It sounded like he was trying to rob you and got scared at the last minute. I would say you got lucky.