my old 96 used to do that, sometimes in the middle of the mountain at 3am.
i would stand it on it's ass, have my buddies hold onto it while i used a big log to rip it out of there
seems besides the obvious ...chain and sprockets were shot, the white swinger chain guide was worn beyond it's life, thats what allows enuf room for the chain to go up in there, replace that white roller and it won't
but i'd guess the chain and sprockets are worn too
nowadays i keep fresh sprockets and a new chain every riding season and have yet to pop a chain off
my suggestion to you now is to remove the swingarm pivot bolt, the big one that runs side to side thru the back of the motor, allowing the swingarm to move enuf to get the chain out
then replace the chain guide roller while you have it that far, and chain/sprockets too
before you bust an engine case