can i make a script to load when the player enters the cell maybe "onload" to get the number of one npc, say a guard in that cell and make a message in the top right and have it say "There are (number of guards in cell) on duty"
Yes there is, see here - http://geck.gamesas.com/index.php/ShowMessage#Formatting_messages.
To display an integer, you'll want to include "%g" in your message where you want the value to appear, then passing the variable storing the value as a parameter of http://geck.gamesas.com/index.php/ShowMessage, after the message itself.