Oh boy, you picked a doozy :)
At first glance, your script doesn't work because of the definition of a 'word' in Pages (well, in AppleScript in general).
Notably, if you ask for 'words of' the document, you get:
{"int", "x", "10", "int", "x", "int", "d", "int", "double", "float"}
Compare that to your wordList and you'll see the first problem:
set wordList to {"int ", "=", "<="}
By definition, 'words' in AppleScript are alphanumeric, do not include spaces, punctuation or other symbols, so you're first checking for 'int ' (note the trailing space), which will never match AppleScript's definition of a 'word' which will always drop the trailing space.
You could change wordList to include 'int' rather than 'int ', but even then you're not out of the woods, because AppleScript's 'words' do not include "=", "<=", etc., so these are excluded.
(side note: there is a little known/used considering/ignoring clause where you can tell AppleScript to consider or ignore white space, diacriticals, and other modifiers, but it still doesn't apply here).
It gets worse, though. Even assuming you could get Numbers to break down the text into space-delimited chunks, the code:
set color of (words where it is aword) to theColor
is doomed to failure. That's because words where it is aword will return something like:
{"int", "int", "int", "int"}
because those are the literal words that match your search term - you asked for 'words where it is 'int", and that's what you get. There's no reference back to the document at that point, so Numbers has no way to change the text's color.
So, what it comes down to is that Numbers really isn't geared to make this kind of change for you. It is possible to do, but only by walking through the document.
Here's a revision to your script that 'walks' the characters and determines which 'words' to change color:
use AppleScript version "2.4"
use scripting additions
set wordList to {"int", "=", "<="}
set theColor to {0, 51 * 257, 179 * 257}
set symbolTokens to {" ", ";", return, "(", ")", ","}
tell application "Pages"
tell body text of front document
set allChars to its characters
set startChar to 1
repeat with i from 1 to count allChars
if item i of allChars is in symbolTokens then
set checkWord to (characters startChar through (i - 1)) as text
if checkWord is in wordList then
set color of characters startChar through (i - 1) to theColor
end if
set startChar to i + 1
end if
end repeat
end tell
end tell
You can see the lists at the beginning which identify the words to colorize, as well as the characters that indicate a word break. Amend these as you like.
Additionally challenges I can foresee include comments (different color?), and there are probably others.
> 2) And a second related question. Is this possible to pass a color in HEX?
Sure, but only if you do the decoding of hex to decimal :)
Pages (and AppleScript) define a color as a RGB triplet of three values 0..65535, so if you want to define the color as a Hex triplet (e.g. 0xFFBB00) then you'll have to do the conversion before you pass it to Pages.