Keeping track of the last 600 shares in a distributed environment seems hard. Let me suggest an alternative for you that seems much simpler, and in fact I came up with specifically to design a decentralized pool:
http://forum.bitcoin.org/index.php?topic=25540.0noone in that thread understood it, but hopefully as a programmer it should be clear to you. The idea is simple: just auction the block reward to the N highest bidders, where a "bid" is a share and "high" means "low hash".