I think I am going to go with the newer boat, but if that offer falls through here are the results on a lot of the questions you addressed
The Tartan 31 is in very good condition as far as the hull, interior, cosmetically, and I've been told there have never been any blisters. The negative part is that it has original sails and mast. The standing rigging was replaced 12 years ago and the running rigging is very stiff. The bottom was painted 18 months ago.
I know I will have to replace the sails. What will that cost?
Do I have to replace the mast? How much is that?
Do I have to replace the standing rigging that was replaced 12 years ago. If so, How much is that?
How much is it to replace the running rigging?
How much is the bottom painting?
If you are newish to sailing and are asking all these questions I'm gonna start by asking you one; Why are you sure the sails need replacing? The surveyor will look at them and give you some advice at the survey (or you can pull them out and go over them yourself. If they are "OK" but should be replaced soon, just sail the boat with them for a month or two while you get used to your new boat. I'd rather FUBAR an old sail while getting to know my boat than a brand spanking new one. You may even find that the old sails fit your needs for a year or two, or three...
The price of sails varies. You can probably replace them for less than $4000 if you shop around or get creative, maybe as low as $3000. There are reasonable ways to save money if you are not going to race or go offshore.
Only a survey can tell you for sure if you need to replace the mast. The odds of that being the case are very low. If you where to walk the boat yards and look for 30 year old Tartans with new masts, you would be hard pressed to find one and if you did it I"m willing to bet it was because of a catastrophic accident rather than wear and tear.
Your surveyor will tell you all about the rigging and what, if anything needs to be replaced. The standing rigging on my C&C 30 passed the survey at 30 yrs old. I replaced it anyway. Find a local rigger that people at your yard trust. Some of these guys race/sail with their customers so they build relationships. That's the kind of guy you want working on your boat.
If running rigging passes the survey but it's "about time" for an upgrade, this is something you don't need to do all at once. Halyards are easier to do if the mast is down, but, most anything can be done as needed.
Advice on bottom paint would be to buy the best you can find. Wait for a sale if you can. The more you spend, the less work you have to do at haul out.
I'm ass u ming you are not going off shore and you don't mind doing some of the work yourself. If the boat is to be "yard maintained" then all bets are off as to pricing. If you are planning on sailing across oceans then throw out all of the above advice and plan on upgrading everything.