A simple version is a script that allows funds to be redeemed by one of two parties, but only if 2 of the 3 participants agree. It could be extended to handle more values, but this demonstrates it well enough.
It's important to note, party1-pubkey and party2-pubkey can't be in the list of pubkeys for the multisig. Otherwise signatures produces by those parties could be pushed again to pass the code in the conditionals.
2 [3 x pubkeys] 3 OP_CHECKSIG
OP_IF
OP_DUP OP_HASH160 [party1-pubkey-hash] OP_EQUALVERIFY OP_CHECKSIG
OP_ELSE
OP_DUP OP_HASH160 [party2-pubkey-hash] OP_EQUALVERIFY OP_CHECKSIG
To release a UTXO on the P2SH address, your scriptSig would be:
1 [party1-sig] [party1-pubkey] OP_0 [2 x multisig sig] [serializedScript]
To release them to the second address, trigger the second address by pushing a 'false' value like the number '0'.