I wonder if it's even possible. But assuming it is, detecting whether or not a piece is allowed to fall is quite an extensive search, which would probably slowdown your game considerably.

There are quite a few things you may have to consider as well. For example what happens when two (or perhaps even more) pieces, one small and one large are next to each other and both are falling. Will you apply gravity to those pieces? Will the smaller one fall on top of the other? Will it roll further down off of the larger piece?

I'm not sure what kind of game you are making, but assuming you're making a worms kind of game. What happens when a large piece is falling and worms are underneath it? Are they killed?

Anway, I'm getting way too enthusiastic again. And now that I read it over, it's actually not even an helpfull answer to you question