I think it makes sense to do it in basically all the cases where handling the event causes the dialog to dismiss (which I think is pretty much all the arms of the if statement, except maybe for the TAB case) - it's not so much about triggering another event, but the fact that the keyup goes to the main editor after the dialog is dismissed. 

I guess I'm suggesting that you go ahead and fix those other cases as part of this pull request, instead of just fixing the Enter case (since I think other cases like Space and Esc could affect you as well anyway). If you don't have time, let me know and I'll take a stab at it.