A service manual is a good starting point. If it runs, but won't idle, I'd tear apart the carb and clean it. While I was cleaning, change the oil, and I'd change the air filter out or at least clean it. I say change because if it's been sitting for a few years, chances are the foam in the filter is crap and needs to be changed out anyway.
Not sure what you mean by the gears are all jacked up, but if there is transmission trouble you will need to really tear into it. You might be better off parting it out and spending the money on another bike. The Service manual will tell you what is involved in changing out the transmission gears/shift levers etc.
Good luck, I got an 86 200xr in a series of boxes about 10 years ago. If memory serves me, I spent 500$ getting that free bike up to working order. But it was a fun project.