There are several lodges in the park and places in West Yellowstone, as well. I found
this blog post when we were planning our trip, should have good lodging info and some ideas to help you plan out your itinerary... Like was said, it'll be a haul from the east gate to Cody and back. If you're going to Glacier, honestly, you're probably not going anywhere near Cody. If you leave from West Yellowstone, head up through Missoula and then Kalispell and Whitefish to West Glacier. If you leave from Mammoth Hot Springs/Gardiner, head up through Bozeman and then up 89 and into Glacier from the east side. We went in from the east side but had to drive across the park on US 2 to get to West Glacier, since that was the only gate open last summer.
We spent 5 VERY full days in YS and still didn't see everything, only partly because the road from
Canyon Village to Tower-Roosevelt was closed. My favorite sites were: Upper Geyser Basin/ Grand Geyser (definitely the best one, can be reached from Old Faithful area); picnic at Great Fountain Geyser (second favorite); hiking the Grand Canyon of the Yellowstone from the lower parking lot up and back (you can drive to the top, though); Mammoth Hot Springs (elk wander town and the springs are pretty cool); Hayden and Lamont Valleys for bison (and bears/wolves, depending on time of year); West Thumb Basin...
I definitely remember seeing people on horseback near Fishing Bridge.
Pack or plan to buy a good shade hat, a sun shirt, and sunscreen. No trees grow where the dirt is boiling hot.