@Sky1,
Yeah it sounds like he is attempting to use reverse psychology on you. Its almost comical in a way.
"I know you really like me but that can ruin our friendship, now let's have a long hug while I pet your head and smell your hair."
Hes toying with you to invest himself without really investing anything. Its a type of manipulation. If you are not ethically opposed to my next suggestion I bet you can prove it.
You playfully attempt to play the same game with him. I know it might sound mean but it's to prove a point to him and you.
When he starts pulling his crap you play along with something like.
"I know we are just friends but what would think if I said we should have sex?"
If he goes straight into supporting the idea he will clearly show his intention that he was really after sex the whole time.
However;
If he says no he's just wants to be friends then you know he's just being an awkward friend.
Its a little mean I'll admit but it hits home calling his bluff to get him to admit his true intentions.
You can say it was just a joke and apologise if it was insensitive.
My money is on him leaping to a joyful, "okay."