This is literally just storing a key/value pair in a map. i.e. Registering a name. It's not complicated, and that's the point (it takes a few lines of code to recreate "Namecoin" on Ethereum)
name = tx.data[0]
value = tx.data[1]
contract.storage[name] = value