So, you want a script to be evaluated when a link is clicked?
Next to the link is a blue := button called 'edit link script'. There you can put the logic for what you want:
IF %VARIABLE < 2 THEN $DEST := @P8
IF %VARIABLE = 2 THEN $DEST := @P9
IF %VARIABLE > 2 THEN $DEST := @P10
(Swap variable name, numbers, and destination pages to whatever you want)
You can also use IF [stuff] THEN IF [stuff] etc to check multiple things.
Check 'editor features' under 'story properties' to see if scripting is enabled (I believe it starts off by default, and the script page for a link might require it to be turned on).
Page scripts along with global link & page scripts also exist.
I'm not an expert, but I believe the difference between these is when the script runs.
Global Link Script: runs when any link is clicked.
Global Page Script: runs when any page is loaded.
Link Script: runs when that specific link is clicked.
Page Script: runs when that specific page is loaded.
I think that covers what you're looking.
Oh, also, there's on page scripting, where you put the script on the page. It is used for checking variables and then displaying text if the condition is true. It looks like this:
%%VARIABLE%=%1%text shown if VARIABLE is 1%%
You can also combine multiple ones of the same variable. Such as:
%%VARIABLE%=%1%first variation%%%%VARIABLE%=%2%second variation%%
You might've already found this in the articles, but because it is useful I figured I'd mention it (just in case).