Good first attempt
You don't need to use widgets for checking to see if its in dialogue or level up dialogue (it's counted as a dialogue)
if (getDialogues().isPendingContinuation) {
getDialogues().completeDialogue();
}
Also try to stay away from using static widgets (widget ids) as they will commonly break during updates.
You can use containingText instead for widgets.