Why are Transactions sending out randomly?
Because it doesn't re-broadcast any non confirmed transaction, it re-broadcast only your own non-confirmed transactions. So you will be the only node on the entire network who is doing the re-broadcast every exact 30 minutes and based on this anyone can get what IP is originating that transaction.

A few lines below your code example you find this:  

BOOST_FOREACH(PAIRTYPE(const uint256, CWalletTx)&amp; item, mapWallet)
{
...
}


This will loop on the transactions of your own wallet (mapWallet), not all the network transactions.