I'm sure JJJ can give you a better explanation, I haven't scripted in a few years so I'd have to read the articles again. But there's a system variable along the lines of $PAGETEXT or something like that, which you can set (:=) to certain words IF variables are within certain numbers. What's also cool is that you can put HTML into these scripts, for example you can put in the Global Script a HTML thing in $PAGETEXT and make the background of every page red and the font another type and colour. There's a thread on it somewhere in the Advanced Editor forum.
But anyway, JJJ's online, I'm sure he'll give you a more detailed response.
LINK HERE to that thread I was talking about.