Hola,
My wife and I spent 30 days in Spain 14 of which were with a car.
Autoeurope is a good starting point to check prices and locations. We got our 14 days with a drop off in a city apart from where we picked up, the so called dead head, for just under $150 + $19 for train station pickup.
4 days in Madrid, train to Cordoba where picked up our car after being resident for 6 days. Then to Baeza, Granada, and Ronda before returning the car in Sevilla followed by a train to Madrid. Parking cost us about 120€. Parking is often 10 to 15€ per 24 hours, it can be more. We were able to park for free in Baeza (if you go there, go to the Cafe Teatro, a must, it opens at 16:00). And about 80€ for gas.
So pick the time when you want or require a car and schedule your rental for only that time.
Get the smallest car you can, many of the medieval streets are too narrow for a mid-sized. Don't let them upgrade you.
Use a credit card that provides foreign auto insurance, and decline all insuances offered at the time of booking, when there is no pressure, and at pick up when they stare you dead in the eye and say, "Tire insurance?", sign the papers and your card gets swiped. You MUST use the same card through out. Best to use a card, take it with you but don't use it as it might get lost or compromised. You need THAT card, don't compromise its safety.
Getting an accident reimbursed is the same whether it is your credit card, or the rental agency's policy. You need a traffic report and documentation. We have used our card's insurance once. Decades ago in the Czech Republic when no one in the countryside spoke English. In that case I included a long, hand written letter explaining the circumstances, and almost in return mail I recieved a check for the full cost of the repair.
Spanish drivers obey the speed laws pretty closely and they use their blinkers when passing and turning. Pedestrians have the right of way.
The roads in Spain, Portugal, and France make you embarrassed of the USA. When you come home, you can't believe the difference. They have new paving, we have patches on patches on patches.
Enjoy,
Wayne freshly home from Spain