How can you schedule a several hour "hop-off" in Cordoba on the AVE from Madrid to Sevilla?
The only way to do it is to purchase two tickets....Madrid-Cordoba, and Cordoba-Sevilla. That'll lock you in to two specific train journeys and will cost you a little more than a ticket Madrid-Sevilla.
To give yourself more flexibility, you could purchase a discount ticket Madrid-Ccrdoba then simply puchase a regular ticket when you head back to the Cordoba train station. You run the risk of not getting a seat on the train you want, but there's at least one train/hour. The discount rate on the AVE for Cordoba-Sevilla is jut under 20 Euro, while the walkup rate is just over 32 Euro. And if you aim for one of the AVANT trains that runs the Cordoba-Sevilla route, a walkup ticket is only 16 euro, and it takes about the same amount of time as the AVE...about 45 minutes.
We did this, although made it an overnight, with no problem by buying 2 tickets. You can buy a slow train ticket from Seville, which is really not much slower, and often cheaper.
Cordoba is a charming town, but you could just stop for a few hours. The Mesquita is about 10-15 min walk from the train station.
You'll save $$ by buying most of your tickets in advance through Renfe, which can be frustrating, but is quite possible