The issue is that the guard saying the dialogue needs to be identified, as (s)he will be part of the quest. Sorry about not being clear on this.
Then your guard should be a named ALIAS in your Quest ... then your dialogue conditions refer to the named-alias.
AND/OR akspeaker
http://www.creationkit.com/Topic_Info_Fragments
So, if you have a line of dialogue, that can be spoken by any one of lots of guards, then you can use akspeaker to get the Reference/ID of the speaker of the line
(depends what you want to do, as to which is better)