There's also a similar thread in the Learning to Sail forum you may want to check.
Much good advice above. Staying away from land is probably preferable to trying to beat the storm in, and get caught too near a bunch of things you don't want to hit, but then can't avoid.
Watch, and trust, your compass. Wind direction can change greatly in a squall, while you're in blind-our rain and can't tell its happening. Your compass, not the wind angle, will keep you heading away from that lee shore.
Also trust your GPS. It will tell you if your making progress away from the lee shore, or being set towards it, or holding a steady distance off. Crucial to know this in poor visibility or good.
Your anchor is your hole card. If you can't avoid getting set towards shore, let it go early, and if it doesn't hold right away, it will at least slow you and keep your bow into the wind, and then will dig in as the ground below you gets shallower.. By this time the average squall should have subsided anyway.