To the original poster, if the light gave you a false sense of security, and you had had the knife instead, would that have been any better? Would you have drawn when he came up and asked what you were looking at? Do you think you would have been legally and ethically okay in shanking him? Replay the scene in your mind, at what point would you have drawn your knife? It's easy to think that a different tool would have been the answer, and in many cases it can be, but often to correction comes from within.
There are some obvious mistakes -- turning your back on him when your friend pulled you is one, that could have been a permanent mistake if he'd really been after hurting you.
The really key moment is when he gets close enough to you to hit you, and you decide not to draw your flashlight lest it provoke an attack. Really, here is where your instincts come in -- given your read of the situation, is it more likely you'll talk your way out of the situation, or is it more likely the bad guy has decided you're his victim and he will attack you regardless? In the first case, you might not draw; in the second, you'd better. The thing is, bad guys know and use this feeling we good guys get of, "oh poop this can't be happening, what do I do?" to get close enough to us to blitz us.
Anyway, I wasn't there and your read proved to be the correct one. But I'd advise you to take this as a lesson learned -- his approach to you is EXACTLY the kind of street "interview" that criminals employ to get close to and intimidate their victims, and they RELY on you not drawing and not quite knowing what to do, and just blitzing you. Did you really read the situation right, or are you just lucky that this was some punk vs. a criminal looking to jack you? This is a good time for some honest introspection! I went through a vaguely similar situation a couple of years ago, no harm came to me, but in retrospect my read on the situation was bad and more active measures were solidly warranted -- it's just luck nothing happened. Now I know what I would have done differently and am mentally more prepared.