That happened to me a few days ago,... I noticed that I could no longer install apps from the Market. So I rebooted the phone,.. still did not work. Performance became slow,... then it would not even let me do a factory restore... I exchanged it,... problem gone so far.
I was having that issue once in a while, Now i called TMobile on a different issue (GPS) and they gave me a similar workaround to what was posted on AC, the site and port were not the same. Since then I have not had the phone lock up on me once in 3 days.
So I figured it out. Check this out: Whenever the phone was plugged into my extra non-OEM charger, it would automatically freeze until I unplugged it. When I use the OEM charger, it works! Is that weird? Who thinks they can explain that?
I've seen this before with my old phone. The phone doesn't like the charge voltage. I would have issues with the touch screen on my Hero. I would just not use the phone while I was charging it. I normally only change at night so its not an issue for me.