This script uses the Raspberry Juice server mod which provides the Raspberry Pi editions python API to the PC Edition.
It allows you and a friend to play a game of Connect 4 inside of Minecraft using sand and gravel blocks. The script will auto-detect when one player wins by getting 4 of their blocks in a row horizontally, vertically, or diagonally.
I used CanaryMod server with Raspberry Juice plugin on PC version of Minecraft. Theoretically this should work similarly on the Pi edition I think. If you get a chance to try it out let me know ;-)