Fix undo state cost accounting when multiple undo states are updated
Add note about insertEvent restrictions to JSDoc