You'll be fine. The bolts may need to be replaced, but they're standard. There's a small bar that screws into the windshield with little screws. That's not going to come off easily, but it can be replaced.
You'll need to clean and paint the top edge of your windshield, and you may discover rust. But it's there whether you take the top off or not. So it's a good idea to get at it.
The body tub where the top meets the body usually doesn't rust, but it'll be good to scrape off any foam/sealants, and clean it all up.
It'll go back on just fine - YJ tops are tough, simple (compared to JK), and usually don't leak. You'll want all new sealer/gasket tape when you reinstall. Camper supply store.
Spend some time with a can of primer paint, and daub all the little screw holes.
All those little areas where water gets trapped can bring rust, but removing things, cleaning and painting are the best solution.