Restore focus back to the event trap after performing an undo or redo
Allow non-edit ops to always be added to the current undo state

Cursor movement and other non-edit operations have no impact on the current
undo state. These are necessary for restoring the correct version of the
document, but should not force a new undo state to be created.