What happens when two txid's collide? Let's suppose that I can create SHA256d collisions, and I use this ability to create two transactions that have the same hash, A and B. These transactions are not the same, but they hash to the same value.

I submit transaction A to the network, and wait until it has a few confirmations. Then, I submit transaction B. Will it get included into the chain? Will it overwrite transaction A?

If the answer to the previous two questions is yes, then what will happen if the block containing transaction B is reorganized out of the chain? Will transaction A be un-overwritten?
No. After transaction A is included into the chain, transaction B is invalid, and will not be mined. If it does show up in a mined block, the entire block is invalid.

It wasn't always like this. Initially, if a transaction had the same txid as a previous transaction, it would overwrite the first one. Then, if that block was reorganized out of the chain, the second transaction would be removed, but the first transaction would not be added. In other words, adding and removing the block would change the state of the unspent transaction set.

That was clearly ricidulous, so under BIP 30, including a second transaction with the same txid when any output from first is still unspent is invalid. It used to be enforced by the timestamp of the block, but it is now applied to every block in the blockchain except for the two that break this rule.