When possible, most of us like to design itineraries that put our sightseeing in our departure city at the very end of the trip. If you do not do that, your last full day will be spent traveling to that city rather than vacationing. In your case, since you could potentially be in a completely different part of Europe, it would be really risky not to leave Austria (or at least Vienna itself) until the end of the trip. You might plan to fly back to Vienna from Dubrovnik, Barcelona, etc. What if that flight was canceled? You could be at risk of missing your flight home, which would be very costly.
What a lot of us try to do (not always successfully because of transportation schedules and uncertainty about when our flight will actually arrive and we'll get processed through Immigration) is move right on to one of our other planned destinations on our arrival day. Figuring out how to do that with the very least risk of missing onward transportation is tricky. When we can pull it off, we are happy that we have made productive use of the arrival day, when many of us are brain-dead from lack of sleep and jetlag. Since that day isn't much good for sightseeing anyway, we are glad to spend it covering some ground we'd need to cover at some point during the trip.
Edited to add: Unless there's a significant reason to do so (such as attending separate special events weeks apart), it's best not to have two stays in the same city on the same trip. It's inefficient to have to go through the process of finding the hotel, checking in, and getting settled in room twice for the same city.
If you want to stick to ground transportation on your arrival day, your practical options are heading to some other city in Austria that you plan to visit (probably fastest, and you're likely to have a lot more choices of departure time), or to Zagreb or Ljubljana. I think transportation to Zagreb might be a bit faster than to Ljubljana, but I haven't dug into the train and bus schedules.
I don't suppose Graz is on your list for Austria? It's quite a handsome city, and it's about halfway to Zagreb.
You could of course look for a cheap budget-airline flight to one of your more distant destinations, but it's hard to know how to time a separate flight like that, and you probably won't have as many departures to choose from if you have to fly.
Have you checked with your airline to see how much it would cost you to alter your airline ticket so you are not flying back from Vienna? The extra travel to get back to Vienna from Spain, Portugal or the UK is going to cost something. It's not just the cost of the ticket itself; if you're not traveling very light, you'll have luggage fees, and you'll have transportation to/from the two airports involved. Plus it will cost you a big chunk of one of your vacation days.
If your trip includes July or August and you plan to go to Madrid, Seville, Cordoba, Toledo or Granada, I'd try for an itinerary that has Spain at the coolest time on the calendar.