We have lots of calls like dialog.bookletLayout.stackLayout.getItems().forEach . No code in MWTemplateDialog or MWTransclusionDialog should have to know about bookletLayout's children. Push the interface up into the bookletLayout (or even into MWTemplateDialog), to look like dialog.getContentItems().
Build this on top of the forked TwoPaneTemplateDialogLayout.