You'd have to store that counter somewhere, probably as an attribute of the object.
It may be easier to use object flags for this purpose. If the flag "blah" is not set, print the first message and set the flag. Else, print the second message.
This will become much easier in Quest 5.2 - there is a new "first time" script. This lets you add some script that will run the first time, and some script to run every other time.
In code it looks like this:
firsttime {
msg ("This is the first time you've looked at this")
}
otherwise {
msg ("You've already done that")
}