Steve, Eger is a 2 hour train trip. Then there is the time to and from the stations so figure 3 hours overall x 2 = nearly 6 hours of travel for a day trip. Not impossible, but not real productive either. And the best parts of Eger are the wineries which you need to get out of town to see. Not horrible as a day trip, but Eger is better overnight and 2 nights are better if you are into grapes. Besides if you are one of those people who fall for Budapest you will be back and you can do it then. The number of repeat tourists to Budapest is simply amazing. I've been there a couple of times myself.
There are a number of good day trips out of Budapest. My favorite to recommend to first time visitors is still Szentendre. 30 minute commuter train there and this great 45 minute boat ride back --- entering Budapest on the river with the Parliament rising before you is spectacular.
If i wanted an overnight on the way to Vienna it would be Gyor and the Archabbey at Pannonhalma. Exactly half way between Budapest and Vienna on the same track as the Budapest - Vienna train. Adds zero time to the trip to Vienna as far as train time so you have more time for Gyor's old downtown and for the Archabbey/Winery. People talk a lot about Melk, and it is interesting, but by and large its just a big museum. Pannonahlma is still very much functioning as it was originally intended to and that adds another layer to the experience.