By "staying on top of your gear" I mean choosing a gear that is easy enough for you to spin at a nice 90-100 rpm without using too much energy. You should be applying ~some~ pressure to the pedals, but it should feel fairly easy. Your quads should not be screaming in agony

Keep pedaling. You might have a few brief moments of coasting or soft-pedaling while in the pack, but in general you want to keep your feet spinning. This will enable you to respond to "jumps"(in speed) within the group. If the group speeds up suddenly or goes hard out of a corner or up a climb you will be able to give it a little gas (perhaps even shifting to a "harder" gear) and stick with the pack.

Hope that makes sense.