Okay, well, if the tour to Budapest is the RS tour with Vienna and Prague, then the tour has 3 full days in Budapest which is pretty “okay”. If that’s the tour, then going back to Vienna to catch a flight isn’t the best use of time. There is a direct flight from Budapest to Sofia (Ive been on it, it’s fine) that depending on the month goes on Tuesday, Wednesday, Thursday, Saturday and Sunday … or … Tuesday, Thursday, Saturday and Sunday … or … Tuesday, Saturday and Sunday; so maybe you spend another day or two in Budapest to make one of those flights. 5 full days in Budapest isn’t too much.
Then if the Bulgaria tour is also the RS tour they give you one full day in Sofia. That’s a bit light. Two full days would be better and 3 sure wouldn’t kill you. So, if the flights work where you get a bit more time in Sofia, that’s great.
Not considered above is if something special is going on in either Budapest or Sofia. Or there might be something special going on in another city that connects well to both Budapest and Sofia. But that requires dates to make a suggestion.