Try to search vanilla code files to see how they do it, eg. the keybinds if you press 1, 2 or 3 to select the chatter options.
https://github.com/search?q=repo%3Ae...tion&type=code
They call:
Code:
INTERACT_WINDOW:SelectChatterOptionByIndex(1)
https://github.com/esoui/esoui/blob/...ings.xml#L1051
This should then update the interact window texts etc. properly (hopefully)
I'm no sure if you can queue 3x INTERACT_WINDOW:SelectChatterOptionByIndex(1) or need to wait after first call to it, so the chatter updates, e.g. raises a new event EVENT_CONVERSATION_UPDATED and you need to react on this then?
Maybe check Dolgubons lazy Writ carfter addon as it does the pretty same while talking to the crafting writ NPC -> skip the "accept quests" dialogs.
Oh and remember you are not only playing in English but might also have to support other languages, so checking for "What's the pledge today?" is not the same if you play in de, fr, ru, es, zh :-)