Haven't used the deckrule language by now so I might be wrong.
My understanding of the rules is the following:
CAST IF
ATTACK IF
CAST AND TARGET
ATTACK AND TARGET
Are used to specify actions the bot performs if (and ONLY IF) the conditions are true.
GAIN FOR CAST
GAIN FOR ATTACK
GAIN FOR CAST AND TARGET
GAIN FOR ATTACK AND TARGET
Are used to specify a value system to evaluate different options.
The higher the gain, the more likely the bot performs this action.
I guess you can also use negative gains to prevent actions.