I'm going to relish in the fact that he hugged me back.
When I saw him later today though, he greeted me (as opposed to ignored me) with a smile and a hey. So... now what?
I did that one day. It was completely out of the blue. One evening, I was talking to my (INFJ?) friend and he had his arm around my shoulders and at some point during the conversation, an unknown part of my brain thought "Eh, what the hell? He always seems to want hugs. Hug him! NOW!" And I did.
He wasn't as surprised (or he hid it well) as I was. I think I mumbled something and a "see you later" and complained about missing my bus.
He was his usual 75% jovial and 25% neurotic self afterwards. So I'm guessing your friend will be fine too. But I'm no expert on flirting. I can't even recognise it.
Yesterday, I bantered a lot. It was witchcraft-and-Doctor-Who-themed.
(Writing about my friends feels so weird. It's almost like I'm violating their privacy.)