I'd like to offer a thought experiment in return: same scenario, but instead of hot gases coming from a rocket, we've got a device firing BB's in the same direction as the exhaust gasses were going. The results should be the same (gasses behave a lot like BB's in a vacuum), but BB's are a bit more tangible and have some heft, so the results will feel a bit more intuitive. You'll get the same results either way.
We know that the momentum of a system is conserved, as long as it doesn't interact with anything outside the system. So if we make our system as "the box, the 'rocket,' and all of the BBs" we can use the conservation of momentum to solve the equations that matter. As it turns out, while energy is conserved, it actually wont end up mattering much, so I wont bother with paying attention to it.
The Boring Answer: momentum is conserved, so the CG of the system stays put. Feel free to fire BB's in whatever direction you want, and have them ricochet in any way you please. That CG is going nowhere!
Getting More Interesting: Now lets think about what this crazy contraption looks like from outside. An outside observer cannot see the BB's bouncing around on the inside. All they can see is the box and the "rocket." Now we know from The Boring Answer that the CG cannot move. Since we start with BB's racing backwards (unseen), that must naturally be balanced by a forward movement of the rocket, tugging the box along behind it. It will look like the rocket and box are moving forward at first. GOOD this matches up with what we want rockets to do: they go forward! Intuition holds!
Now Things go Splat: Time to let the BB's hit the back end. For a moment, let's pretend all of the BB's are made of silly putty, and splat on the back wall in a decidedly inelastic collision. They all come to a standstill at the end. Once again, the CG can never move (thanks to The Boring Answer), and since the BB's are done moving, clearly the rocket and box must stop moving too. That way momentum is conserved. From the outside, it looks like the rocket nudged forward when it fired the BB's, then came to a stop when they splatted at the back.
But What About the Bounce: Okay, lets use some BB's that will bounce, like you want them to in the thought experiment. As far as momentum is concerned, a bounce behaves just as though you caught the BB inelastically, then shot the BB right back the other way (the only difference between this and an elastic collision is that I'd lose energy to heat when it got caught, and have to inject energy to accelerate it the other way. Elastic collisions just do both of those at once for me).
So lets take the most extreme case. Somehow the far end of the box catches all of the BBs (like they were silly putty), and then flings the right back towards the rocket (emulating a bounce, but breaking it into two steps so that our brains can make a little better intuitive sense of it all. In this case, just like before, the splat arrests all motion in the rocket/box. Then we relaunch the BB's towards the rocket. Just like before, this now looks like the rocket/box is moving to keep the balance around the CG, but now the box is going the other way!
Bouncing Back and Forth: What if the bounces are not perfectly elastic, bleeding off a little energy, but they do magically reflect right back towards the rocket, rather than scattering in other directions. Then, when the BB's hit that side, they also bounce right back with a little less energy, right at the far side of the box. This is your inelastic gas scenario. Well, because the CG is holding still, but our outside observe can't see the BBs, it will look like the box is oscillating back and forth, starting with large movements and slowly quieting down. Eventually the box will be "still." At this point the rocket/box will look like it stopped just a little bit forward of where it started. This will match up exactly with the movement needed to keep the CG at the same place after the BBs moved from the front (right up by the rocket) to wherever they settled near the back.
However, Nothing Is Perfect: In reality, the BB's aren't going to bounce so cleanly. They're going to scatter a bit, taking different paths around the box. Like before, the rocket will appear to move forward, then stop and go a bit backwards. However, now that each BB is on a slightly different path, each one will take a slightly different amount of time to collide on the other side. As before, the rocket begins moving forward again (to counterbalance the BB's moving backwards), but this time it won't be a sharp edged shift in direction. It will accelerate forward to full speed over a period as the BB's take their turns colliding in the front.
When BB's Collide: Now eventually these BBs will collide with each other, just like gas atoms will. When this happens they will ricochet off in different directions. In theory the directions are predictable, but you'd have to keep track of all of the BB's positions and velocities, so its easier to just assume they go off in a random direction each time.
This is why I didn't have to worry about the conservation of energy. Eventually, the BB's will statistically balance out so they are uniformly distributed in the box. For every BB that hits the back wall, a BB also hits the front wall around the same time, so you don't see any net movement. They all bounce off each other like crazy. If the collisions were inelastic, they'd eventually die down. If they're perfectly elastic (gas collisions are really really close to elastic), they would continue bouncing around like crazy, but their average movement would go nowhere.
So this can be used to answer your final question, of the continuous rocket. At first the rocket is firing into vacuum, so it goes forward as intended. However, as it continues to fire, it becomes less likely that a BB will make it from the rocket to the back wall without colliding with a ricocheting BB first, giving it a random direction. However, in doing so they'll impart a little backwards momentum to the ricochet. Eventually that momentum will work its way to the back of the box, even though it wasn't a direct path.
Once the BB's start ricocheting a lot, rather than hitting the back wall directly, we can think of them as a giant gas cloud of BBs. The cloud itself has a CG (the center of the BBs). Once the cloud gets full enough and random enough, that CG will be roughly the center of the box. We can use this to finally understand the movement of the rocket.
The rocket will move forward, and then stop as the gas collisions in the box start to mount an effect. In the end, the rocket/box will move forward exactly far enough to counterbalance the movement of the CG of the BB cloud from the rocket (where they all start) to the center of the box (where they statistically end).
Once again, from the boring answer, the CG wont move. However, from the perspective of an observer that can't see the rocket fire, it will look like the rocket moves forward a little bit, then stops dead in space.