There are three places I stayed for 2 nights or more that could be done as day-trips, depending on how many sights intrigue you:
- Toledo has a great deal of interest and gets heavy day-trip traffic, so overnighting is recommended. It's a very atmospheric city with a huge historic district. This would be my top recommemdation in any case, but especially if you do not get to Andalucia, because Toledo would give you an opportunity to see mudejar (Moorish) architecture.
- Segovia is probably the easiest of the three to knock off in one day, but there's more to see than the aqueduct.
- Cuenca is off most American tourists' radar. It's midway to Valencia but can be a day-trip via the AVE, which is fast and expensive if booked at the last minute but reasonably priced if you get your tickets early. People who like modern art will want at least one night there, because it has two smallish but interesting museums. With a car and more than one night you might be able to combine Cuenca, Teruel annd Albarracin. I haven't been to Albarracin but Teruel gets very few non-Spanish tourists,and has a bunchmof mudejar towers.
I found Avila underwhelming, despite the wall. That is something the guide books sort of hint at.
I have not been to El Escorial.
Salamanca has a large historic district. That, in combination with its distance from Madrid, makes it perhaps less than ideal as a day-trip. It's a worthwhile destination, but I much preferred Toledo.
The logical targets for a 4-day loop would be Cordoba and Seville, but be aware that Andalucia is likely to be miserably hot at the time of your trip. The area around Madrid probably won't be quite as bad but will likely still be very hot. Push the trip as late into September as you can. Cuenca is at 3000 feet, so while it won't be really cool, it will probably be a bit more comfortable than Madrid.
Two small places I liked for day-trips where you're unlikely to see other Americans are the handsome old college town of Alcala de Henares (via local train) and the quirky small town of Chinchon (via bus).