In response to a discussion page on the wiki (don't use those, really, the forum is much more likely to get a response) I made this snippet:
def aimrx 971
start
*.aimrx 0 =
1 rnd 0 = overbool overbool and
.aimsx .aimrx store
dropbool not and
.aimdx .aimrx store
dropbool
true
10 *.aimrx store
stop
This will randomly chose between turning left and right and then makes it easy to use the choice anywhere with the "new sysvar" of aimrx. 971 is a Racial Memory location, so the value will persist across generations. If you don't want that just change the def.