I suppose you have a rule for writing a paragraph about the guard? Then, say the guard’s line in that same rule, making it dependent on some condition or other. E.g.:
For writing a paragraph about the guard: say "A guard is here.[if the player was not in the street]'Halt! Who goes there?'[end if]"
if you want the guard to demand that the player identifies himself each time he enters the street, or
For writing a paragraph about the guard: say "A guard is here.[first time]'Halt! Who goes there?'[only]"
if you want the guard to do so only the first time the player shows up.
Whenever you want something to display at the end of a turn, you can use an every turn rule. This works: Every turn when going in the presence of the guard:
say "'Halt! Who goes there?'";
For writing a paragraph about the guard: say "A guard is here.[if the player is holding the lantern and the lantern is lit]'Halt! Who goes there?'[end if]"