I would write this as:

    if (e.type === 'click') {
      return e.target.dataset['action'];
    }

    switch (e.keyCode) {
      case insertKeyCode:
        return 'insert';
      case deleteKeyCode:
        return 'delete';
      default:
        return null;
    }

So, some things to keep in mind:
* Prefer an early return to avoid excessive indentation.
* Watch out for this pattern of assigning to a variable and then returning it, when you could just early return instead.