technically, the ingame gold (as everything ingame) belongs to Blizzard, whereas the game code belong to whoever purchased them.

Buying codes with ingame gold is pretty much like buying stuff with someone else's money. I would be pretty surprised if that was allowed..

Then again i haven't seen the second set of rules yet :-)