Why do I have an "iMessage" and an "SMS" thread for my contact?
Solution 1:
iMessage threading is a total mess. I have an iPhone 4 and an iPad 2, both with iOS5. So does my brother. Not including regular SMS messages sent/received with iOS4, I now have three different threads of messages from him on my iPhone, seemingly depending on which device the message was sent/received on. I have two on the iPad, but these don't correspond exactly to any two from the iPhone.
I understand that iMessage (like FaceTime) can only address contacts by email address on a WiFi-only iPad, and can address by both email and phone number from an iPhone, but these all resolve to the same Apple ID on the server, and to the same contact on the device. Surely it should be possible to merge these conversations, either on the server (by Apple ID) or on the device (by contact).
Perhaps a fix will appear in a future iOS update but for now this rather takes the edge off an otherwise cool new feature.
Solution 2:
I can imagine this might happen if he doesn't have an iPhone but does have an iPod Touch or an iPad.
So when you send him an SMS it goes to his non-Apple phone (or non-iOS5 Apple phone) and when you send him an iMessage he receives it on an iPad or iPod Touch which is running iOS5
iMessage is associated with an Apple ID. So if your friend has several iOS5 devices, his iMessages from you will be received on each device, however regular SMS will only go to his phone. If his phone is running a version of iOS preceding iOS5 (or isn't an iPhone) he won't receive iMessages on it and the threads will never merge on your phone because they're sent on two separate devices by your friend.
Solution 3:
My girlfried had a similar issue, when I checked the iMessage settings page the 'receive as' setting showed an error for her number and was defaulting to her gmail (I assume this occurred when the gmail address was added when she used facetime on her iMac). I simply turned iMessage off and back on again and it seems to have resolved the problem.