Counting two parts cars, I've bought 10 Boxsters. Never owned or seriously considered a Miata, but they look like fun little cars. I can't compare, but I can advise a little about the 986s. I like working on cars and the ones I bought were depreciated or salvage. I have fixed all the common problems multiple times. Some can be a bit annoying, but no more expensive or difficult than similar repairs on other cars I've had - easier than many.
Some basics:
All the worry about IMS bearings is Overrated. Until you are the one who has one go bad. Buying a car that you can Verify has had the bearing replaced, or planning to do it with the clutch is a great idea, but don't let the worry ruin enjoyment of the car. I have replaced two myself and had a shop do one for me when I was too busy and had a leak at the seal. If you DIY, it's not hard to follow the correct procedure. With an '05 model there is no way to know if you have a replaceable IMS bearing or the newer larger one without removing the transmission.
Buy a car that has had the water pump, coolant tank, and AOS replaced, or plan to do it at some point. These cars are 15-20 years old and things wear out with time, not just miles.
Much like buying an Audi, you do well to shop for the right previous owner rather than shopping specifically for the car. An enthusiast owned car can save you a lot of headaches over a worn out trade from a used car lot.
It's a great car to work on, but different. Lots of the maintenance can be done from underneath, or from the side with the wheels off. Brake pad and rotor change is the easiest on any car I've owned.
There are some good aftermarket parts, but some things like the coolant tank and AOS, it is best to go with the Porsche part (or Pierburg water pump).
2.5L/2.7L Base or S? Both are fun. If you need to have the bestest and fastest get the S (you are considering a Miata so the base is fine). I have just as much fun in a '99 as I do in an '04 S, but that same fun in the S will put me into more expensive speeding tickets.
I've seen a few fixes that were done very wrong. Don't hesitate to walk away if things don't quite look right. There are lots of Boxsters in the world and there will be a better deal next week.
Final note: If the amount of money you are spending is significant, have an experienced Porsche mechanic do a pre-purchase inspection. With all the cars I have bought, I know I will still miss things that a disciplined pro will find.