Not quite.
The def commands are placed before the start of the actual genome.
def simply sets up a custom sysvar with any name that you choose, to represent a specific memory location. In this case .type becomes the equivalent of memory location 50.
*.type exactly equals *50. it is just easier working with a sysvar than a raw memory location.
Your code should look like this.
def .type 50
'genome starts here
cond
*.robage 0 =
start
2 rnd 1 add .type store
stop
cond
*.type = 1
start
100 .up store
stop
cond
*.type = 2
start
100 .dn store
stop
cond
*.type = 3
start
100 .dx store
stop
end
This sets up the ".type" as a custom variable then sets a random value of 1,2 or 3 into it when the robot is born (age = 0). For the rest of the robot's life, .type will contain the same value (unless you change it from another gene at some point)