I would consider flying to Grenada for 2 days, train to Cordoba (check luggage) spend day at Mezquitan and them jump back on train to Sevilla for 2-3 three days then fly to Lisbon for 4 days then home. Lisbon is great and you will have plenty of time to explore Lisbon, Sintra, Cascais etc.
On the other hand, consider keeping your current trip to Spain as is (Personally, one less day in Seville and an additional day in Madrid unless you have already been to Madrid) and then returning to Portugal ASAP!
No matter what, you are going to have a wonderful trip!