If you can get the carpet up, check the joints between the floorpan and under the doors. My GTS hatch has a pretty big seperation on the driverside, i'm going to have to strip the whole car and send it out to be all welded up. Perhaps spot welded too
But yeah, depending on the rust of the sunroof, it might be rusted around it, on the surrounding roof. You will have to cut the roof out and replace it, I should know this because we have a 240 coupe that has to have this done. Expensive and a pain in the arse.
If the body is good, like Trueno_Sprinter said, mechanicals are a dime a dozen, so don't worry about that, worry about the actual shell. That's what really matters when buying one.
Good luck with it.