It could be used for that, but all the code I showed above did was make a random number between 1 and 3, then depending on a number go to a different page. I mean you could add more stuff to do that, for example:
%SHOOT:= 1D3
IF %SHOOT = 1 THEN
$DEST := @65
ELSE IF %SHOOT=2 THEN
$DEST := @66
ELSE IF %SHOOT=3 THEN
BEGIN
%DAMAGE := 1D8
IF %DAMAGE - %HEALTH > 0 THEN
BEGIN
$DEST := @67
%HEALTH := %HEALTH - %DAMAGE
END
ELSE
BEGIN
$DEST := @68
END
END
So, once we have established the player is attacked (If %SHOOT = 3), then we decide how much damage is done, which is between 1 and 8 damage (Green part). If the damage done is less than their health left (pink part) then they go to a page where they're still alive but injured. Otherwise, if the damage done is more or equal to their health, they go to a death page (red).
You should read a bit more into scripting to find out what you can and cannot do. Just go to "Help and Info" and start reading the articles involving scripting.