I would not include Barcelona on this trip. Catalunya is worth as much time as you have (or more) all by itself. I also agree about Portugal and the Canaries.
I don't think I'd push to do a full-scale assault on Andalucía (which would include the somewhat-difficult-to-reach Granada as well as Seville and Cordoba). You certainly could consider a day-trip to Cordoba (under 2 hours one-way by train) if you primarily want to see the Mezquita. But that will mean an AVE train, and those tickets are priced best when they initially go on sale. You may have trouble finding something affordable at this point, and it would mean committing to a specific date and time with no changes or refunds. Seville's farther; to do Seville and Cordoba would mean some nights away from Madrid, for sure. Again, AVE fare at this point could be rather costly. Check the Renfe website to see what it looks like. Certainly, the weather down there will probably be warmer than in Madrid.
Rail fares to Toledo don't vary, so you don't have to rush to pin down that trip. Rick does warn, however, that the last trains back to Madrid in the evening sometimes sell out (probably a bigger risk on weekends and holidays), so it would be prudent to buy the return ticket at the same time as the outbound ticket. In a pinch you can try to get a spot on the bus, but those can sell out too, and they take longer.
In Spain, round-trip tickets occasionally are about the same price as one ways, so it's always smart to check for that possibility.
Segovia is usually the second recommended day-trip from Madrid. I see varying rail fares to Segovia, so if you can pick a date for that soon, you may save some money.
I like Cuenca a lot, but the only way to do it in one day is by AVE, and those tickets get very pricey at the last minute. It may be too late to snag good deals to Cuenca, though you might find something on a weekday. Aside from its medieval district on a hill along a ravine, complete with hanging houses, Cuenca has a nice cathedral (English audio guide available) and a couple of good modern-art museums. Check days and hours of operation if any of those interest you.
An easy side-trip from Madrid that requires no planning in advance is the very pretty university town of Alcala de Henares. It's no more than 80 minutes by local train from Atocha Station. You wouldn't necessarily need a full day there. I found it a very pleasant break from Madrid, which has a sort of monumental feel to it.
A more obscure side-trip is to the town of Chinchon. I think it's fairly popular with Spaniards but doesn't get many foreign tourists. You'd go there by bus.
Personally, I found Avila imminently skipable. Yes, it has a wall, but there's not a great deal else.