First, there's enough to see and do in Barcelona to fill all your time there. Montserrat is a monastery visit and hiking with views. Girona is an interesting town with an impressive cathedral and a well-preserved, albeit rather small, medieval center. The Jewish museum is worth a visit because it details daily life in the middle ages. However if you're short on time in Barcelona, Cordoba and Toledo have more of the medieval to offer. Another day trip is to Figueres to visit the Dali Theatre and Museum and the jewel collection.
There aren't many options for a day trip from Sevilla. You could go to Jerez by train to see a show at the Royal Equestrian School and take one or two sherry bodega tours. Cadiz can also be a day trip by train. You could go to Cadiz for half a day from Jerez, but the horse shows (at least back when I went) were from about 11 to 1, and it may be hard to get a taxi back to the train station. That leaves you an hour or two before the show to see a bit of the city's center, maybe one sherry tour, before leaving for Cadiz. The center of Jerez is about 15-20 minutes' walk from the train station, but the horses are quite a bit farther and there aren't a lot of buses, especially right after the show, when most people are looking to leave. You could also visit Arcos, train to Jerez then bus. There are a very few buses from Sevilla to Arcos, but most of the time the schedules aren't convenient. Another suggestion is to visit the Roman ruins at Italica by bus. Some of the mosaics are very good and there's enough of an amphitheatre and a few buildings left to make it interesting if you are especially interested in Roman ruins.
I'd take at least 1N from Sevilla and add it to Cordoba. While the highlights there, Mezquita and Juderia, can easily be enjoyed in a day, there are plenty of other sights to fill more than 2 or 3 days.
I find Madrid to be the least interesting city in the area you're covering and among the least interesting of European capital cities. If you love European painting you will want the best part of 2 full days for the art museums, and one more day for other highlights. A popular day trip is Segovia. Toledo is much much better as an overnight, or even 2N. There's enough to fill 2 days there.
I agree that Portugal really needs 2-3 weeks on its own and it wouldn't be hard to fill 4 weeks there. Unless you think you'll never ever get back there, I would just keep it on the list for another time. If you have another week, add it to Spain. There's a lot you won't see in 3 weeks. More Barcelona, a few days in Valencia and/or Malaga, rent a car between Sevilla/Cordoba and Granada and spend 2-3 days in the scenic hills visiting some of the pueblos blancos like Ronda, Arcos and Grazalema - just a few of the many options.