For several years now I have sometimes woken up with a pain in my right testicle that will last for several hours or even the majority of the day.

I saw a doctor once when I got concerned about it, and was nervous that it might be indicative of testicular cancer or something. He did the, uh, check, and then took urine and blood samples and said he'd get back to me if anything was wrong -- I guess there wasn't.

I think it's caused by me sleeping in an awkward fashion and, I don't know, kind of "strangling" or otherwise abusing my testicles. When I wake up with this pain, my pants are usually really twisted up and tight. I sleep on my stomach, if that has any bearing.

Does this happen to anyone else? Recommendations? Just sleep naked or what?

If it's of any relevance, this is not a daily occurence. Maybe once every two months or something, and the pain never lasts till the next morning.

Your testicles are probably overheated, or possibly slightly bruised... I suggest wearing briefs instead of boxers if you don't already, because even though briefs will overheat them more they'll also protect them from bumping around; and sleep in much lighter clothes.