Currently, if you control 51% of the network hashing power, then you can force the longest branch of the blockchain to contain anything you want. However, another client's view of the blockchain will reflect the longest legal branch that it sees, by its own definition of legality. Any miners that don't consider it to be legal will start their own fork. (This is exactly what happened, briefly, with the LevelDB fiasco some time ago.)
I think you'd have to do this in two stages. First, create a version of the client that accepts a particular exceptional transaction if it appears in the blockchain. Wait for a supermajority of clients to switch to the new version; once the fraction gets high enough, everyone else will be forced to upgrade too, or risk being on the losing side of a schism. Then it would be safe for miners to actually execute the transaction.