opponent plays a doom against me.
i've got diplomat in hand.
when do i choose to reveal? before or after I know what the hex will be?
do i have the choice to draw before or after the hex applies (relevant for greed)?
You must choose to reveal
Diplomat and do the drawing and discarding before the Hex is revealed.
The "First" in Diplomat's text means that you do it right when they've played the attack; before they've followed any instructions on the Attack.
This question used to come up a lot with reactions to attacks such as
Pirate Ship and
Minion, where the player can choose how to use the card. And in the same way, you must reveal
Moat or another reaction before the player makes their choice.
As a side note; first edition Moat didn't have "First", but the rule was still the same. However, the wording was inconsistent with the way other "when" events happened, because "when X happens" in general means "as soon as X is done happening", but "when a player plays an attack" has always been an exception to this. Adding "First" to the reaction wording was meant to clarify this.