CC - the RS advice on Tangier is not the only thing in the RS guide books that is best ignored (most of the info and recommendations are good). Last year I took a guided tour to Morocco for 14 days, though the route took us very close to Tangier, we did not go there. I compared my tour itinerary to several other popular companies - none went to Tangier. Morocco is a wonderful country to visit and I highly recommend it, but not Tangier and not for a day.
The Alhambra is wonderful but if you can't be sure of spending several hours there, don't go to Granada. It's time-consuming to get there and the other sights don't warrant it, especially compared with the rest of Andalucia.
Malaga may be a better choice than Nerja for a beach. And it's a lovely town with interesting sights as well. What about Cadiz instead? There's a lot to see and do and it's close enough to Sevilla for a day trip.
Barcelona needs more than a couple days, especially when you're in a jetlagged haze. If you cut Tangier, Gibraltar, Nerja and Granada, you will have more time in the other locations to relax and enjoy your trip.
Feria in **Sevilla is a major week-long festival. This year it's from May 5 to May 12. Plan to avoid it - too many crowds and by now any "bargain" priced rooms (high high season) will probably be long gone.
If you love European painting, you'll want 2 full days in Madrid for the great art museums, otherwise 2 nights is enough. I like that you are spending a night in Toledo, maybe spend 2 and take a morning train to Sevilla or Cordoba - another great place for 1-2 nights. You could rent a car when you leave Cordoba and spend 2-3 nights in the hill towns, including Ronda, then drop the car in Sevilla. I'd go to Toledo from Barcelona, and leave your last days for Madrid, thus eliminating one more hotel change. BTW, to make it easier, you can store most of your luggage in the Madrid train station on the way to Toledo and pick it up on the way to Cordoba/Sevilla, just take a small overnight bag to Toledo.
If you are 60+, you can buy a tarjeta dorada for €6 when you get to Spain at any train station with proof of age (passport, driver's license). With that card you can get 25% - 40% (depending on the type of train and day of the week) off full price tickets on fast trains (not regionals, which you probably won't be using anyway). Though this article is a couple years old, it's still a very good lesson in train tickets in Spain. Use the renfe.com site for routes, prices and timetables. Tickets usually go on sale 62 days in advance, but it's erratic. There are some highly discounted prices, they sell out quickly, so a lot may already be gone. Much of the time, the tarjeta dorada price is almost as good (sometimes even better!) and it has all the benefits (cancel, change, refund, etc) of a full price ticket. To compare, when you look for a train on the Renfe site, after putting in the cities and date, add "1" tarjeta dorada. Then choose a train on the next page and click the + box on the right. That gives you details. Click on the drop-down menu for fares and you'll see all the available fares. You won't be able to buy tickets until you have the card number. If you find a no-change, no-refund promo price that is better than the card discount, and you want to buy it, use PayPal. Most US credit cards won't work.
Once you are in Spain with your card in hand, you can buy tickets in advance in train stations (expect long lines) or online.
Spain is an amazingly wonderful country. Assume this is only your first trip. Slow down a little to soak it up. Like a good wine (or chocolate), don't try to chug it down, sip it slowly.