user323: Some pools use a modified bitcoind that uses different rules for choosing the transactions to include in a block. Are there any pools that knowing one transaction to be included in a block would discard it if another transaction on the same inputs would arrive with a higher fee? That is to say, when faced with a double spend attack between a transaction that arrived earlier and a transaction that pays them more, the pool would choose the latter?

user2699: In your scenario there are two transactions with the same input, i.e. an attempt to double-spend.
If the first transaction is already part of a block in the chain, the second one can not be included in any block on top of that block. Other nodes would reject that new block. A miner could build his new block on top of the last block before the first transaction, but that fork of the blockchain would never catch up with the original chain, unless more than 50% of the networks hashrate also builds on top of it. That's the mechanism preventing double spending.
If the first transaction is not yet part of the blockchain (i.e. 0 confirmations), a miner can choose which one to include in the next block. Choosing the one with the higher fee would be a sensible choice, but I don't know if that is implemented in any client. In that case the first transaction would be discarded, and never become part of the blockchain, since it's effectively the same scenario as above.
So, no, there is no potential for a double spend attack through higher transaction fee.

user4607: It seems as if there is such a pool now, advertising the behavior as a feature to allow "reverting mistaken payments":
BitUndo
They also supply a patch to bitcoind.

323: <p>Some pools use a modified bitcoind that uses different rules for choosing the transactions to include in a block. Are there any pools that knowing one transaction to be included in a block would discard it if another transaction on the same inputs would arrive with a higher fee? That is to say, when faced with a double spend attack between a transaction that arrived earlier and a transaction that pays them more, the pool would choose the latter?</p>
 2699: <p>In your scenario there are two transactions with the same input, i.e. an attempt to double-spend.</p>

<p>If the first transaction is already part of a block in the chain, the second one can not be included in any block on top of that block. Other nodes would reject that new block. A miner could build his new block on top of the last block before the first transaction, but that fork of the blockchain would never catch up with the original chain, unless more than 50% of the networks hashrate also builds on top of it. That's the mechanism preventing double spending.</p>

<p>If the first transaction is not yet part of the blockchain (i.e. 0 confirmations), a miner can choose which one to include in the next block. Choosing the one with the higher fee would be a sensible choice, but I don't know if that is implemented in any client. In that case the first transaction would be discarded, and never become part of the blockchain, since it's effectively the same scenario as above.</p>

<p>So, no, there is no potential for a double spend attack through higher transaction fee.</p>
 4607: <p>It seems as if there is such a pool now, advertising the behavior as a feature to allow "reverting mistaken payments":</p>

<p><a href="http://www.bitundo.com/" rel="nofollow">BitUndo</a></p>

<p>They also supply <a href="https://github.com/bitundo/bitcoin" rel="nofollow">a patch</a> to bitcoind.</p>
