No, I don't think that is a reasonable itinerary. You have probably got less than one full day in Madrid, and you definitely have less than a day in Granada, Valencia and Andorra. I agree that Andorra is a curious choice if you mean the capital city of Andorra la Vella rather than just wanting to see some mountains.
If you're not arriving in Madrid until August 17 after quite possibly a sleepless night on the plane, I think it's asking a lot of a family of 4 to deal with the arrival airport, pick up a rental car, check into a hotel in Madrid, drive to Toledo, actually sightsee in Toledo, and drive back to Madrid. Few people would be safe to drive back to Madrid like that, late on their arrival day. (And this part of the trip could easily be done without a car.)
I believe you haven't taken a close look at driving times. You can use ViaMichelin to look at your proposed route, but allow extra time, because folks here say VM is too optimistic. You must investigate every leg of your planned journey, adding in time for checking out of your old hotel (if you're not just taking a day-trip), finding parking at your destination, and checking into your new hotel.
ViaMichelin says it will take at least 6 hours to drive from Valencia to Andorra and at least 4 hours to drive from Andorra to Tossa de Mar, a beach town I selected randomly since I don't know where you're headed on the Costa Brava.
I often visit places for half a day or even less, but I would have to have an incredibly good reason to do so if I was going to need many hours of transportation time or if the destination was a large city (time-consuming to navigate, and nearly always with multiple days' worth of sights that would have to be ignored).
One day is pretty minimal for Seville, and I think when you delve into your guide book you'll come up with far more things to do in Barcelona than can be accomplished in 2 days. I suggest that you start by dropping Andorra and Valencia unless the latter is being included because you think your children will like the science-oriented stuff. If that's the case, I believe either Madrid or Toledo needs to go. And even that may not open up enough time to enjoy the other destinations.