How do I have a coversation with a character

After player says “Where am I?”:
say "‘Where are you? cough, cough Here of course. Right in this field, on that patch of grass.’ says the stranger. "
After player says "Who are you?:
say "'That is not…ect

How can I make the character say a certain think following a certain sentence that the player would say?

You are probably best off using one of the extensions for setting up conversations, such as Quip-Based conversation by Michael Martin or Simple Chat by Mark Tilford.