IF %VARIABLE = 1 THEN $DEST := @P18 ELSE $DEST := @P16
The very first bit of scripting I ever learned. In my case the variable checked whether the player had chosen to kill a certain NPC earlier, and moved them to a different branch of the story if they had.
If you're as hopeless with scripting as I am, I'd also suggest you make use of the notepad under My Stuff, and copy down any little snippets like that as you learn them. There's a lot that act as simple building blocks and can be applied in a billion different ways.