I agree with Bruce. Ljujbljana is a charming city, and there are nice nearby side-trips, including to Lake Bled. Importantly, Ljubljana is not so easy to get to from points west, whereas it's well connected to Zagreb by both train and bus. This is a great opportunity to see it. The city has some interesting museums and a castle.
Definitely not Budapest+Prague in the time you have; total train time would be over 25 hours! Flying to Prague isn't a crazy idea if you can find well-priced non-stops.
Also a "no": driving to Dubrovnik. It's basically a full-day drive.
Another possibility would be to rent a car and head to Istria. Rovinj, Porec, Vrsar, Pula, Motovun, Groznjan are all picturesque towns. Pula has one or two Roman ruins; in the others you're surrounded by old architectures but not a lot of "sights" as such. The countryside in the interior is scenic, too.
Alternatively, target Plitvice Lakes National Park and Zadar, possibly extending to Sibenik or a Split (that would be a rushed visit). You'd want to work your itinerary so you arrive at Plitvice mid-afternoon or later, planning to do the bulk of your walking inside the park first thing the next morning. It is miserably crowded during day-tripping hours and probably worst on weekends when you also may have more than the usual number of Croatian visitors. So you'd head to your southernmost planned stop first, then go to Zadar on Sunday until time to depart for Plitvice. If you go no farther south than Sibenik and get an early start on Saturday, you could probably see that city and drive back up to Zadar to spend Saturday night. One of the monuments along the Zadar waterfront needs to be seen after dark. Hit the park on Monday before heading back to Zagreb.
I think visiting the island of Krk or Rab might also be possible in the time you have, but I'm not sure that's the best plan on a weekend. It might not matter, though.