In thinking back on my own chilly experiences and in speaking with others who have survived such events, the key is to mentally rehearse your response beforehand. In a plunge through the ice, there will be little time to think about what to do before immersion hypothermia is upon you. So, after you've read this, sit down and run through it in your head.
Here are two events I am personally familiar with. In the first, a dayhiker wearing cotton clothes fell through the ice while scouting the bottom of a snow-covered canyon. He went into the water perhaps four feet. His response was one of panic. Upon pulling himself out, he began to frantically make his way back to his vehicle about a half-mile away. He ended up plunging through a dozen other frozen waterholes and eventually succumbed to immersion hypothermia. He died approximately an hour after the initial plunge.
In the second, a friend who is an experienced woodsman was hiking across a frozen lake when the ice broke and he fell through. The ice was two-feet thick over most of the lake, but he hit a pocket of thin ice beneath the snow while approaching the shoreline. He went in up to his chest. His first response was to grab the edge of the ice and to force himself to take several deep breaths to counteract the constricting effect of the cold on his chest.
He then began to flutter kick his legs to allow his body to go horizontal. This made it easier to pull himself out. From there he crawled (not walked) to shore. He immediately made a huge bonfire and spent the rest of the afternoon drying out before walking around the lake to return to his truck on the other side of the lake. He was wearing wool, which unlike cotton, retains its loft and insulating ability, even when wet.
Here is my advice boiled down to a few pointers. Your initial danger in falling through the ice is not just the cold, it is drowning. Try not to gasp if you go under. If possible, hold on to the edge to avoid going under. Force yourself to breath deeply and try to relax. Next, flutter kick your legs until you become horizontal. Once out, roll your body several yards away from the hole. Avoid standing as you may break through again.
What you do after getting out will depend on your proximity to help. With the few times I have inadvertently taken a plunge, my situation dictated that I get a fire going ASAP as I was miles from my vehicle. This is where having your survival gear in your pockets can be a lifesaver. Either way, you will want to dry out, warm up, make an anti-hypothermia drink such as a cup of hot cocoa with a tablespoon of butter, and wrap up in your sleeping bag.
One last tip: if you see someone fall through the ice, don't rush to pull that person out. You may suffer their fate. Instead, coach them through the above steps from a safe distance and, if possible, extend them a rope or long stick to help them out.