I thought I was randomly dislocating my knee, and after a few years, finally went back to the ortho. I described what was happening and the exact circumstances that caused it, and he said he thought what was going on is that I have a torn medial meniscus. When I sit specific ways (cross-legged on the ground or with my legs splayed out to my side), the torn piece folds and basically gets stuck. If I keep moving the leg (while in excruciating pain), it will eventually pop, and the pain goes away immediately.
As long as I avoid the offensive sitting positions, I generally don't have issues...unless I do something really aggravating like walking down a ski slope.