Due to the implementation of IsStandard, such transactions don't exist on the main bitcoin network. Also current bitcoin clients do not support redeeming these transactions at all. So currently you have nothing to worry about.
if I sent a bitcoin transaction with a script which contains a "check if receiver has keya and keyb" I can determine if two addresses have the same owner - or more specifically are in the same wallet.
This would be a total shot in the dark - you would see two people on different forums, which have posted different receiving addresses, and wonder whether they're the same person. So you make a transaction which requires both addresses, and you send it out.
Whether they're the same person or not, you'll never get your money back! You may also have had to pay a fee just to get it into a block; you lose that too.
In the future there might be a special user interface for redeeming such transactions, who knows.