The main thing to understand is that formally, those 2 options are not active at the same time, you get first the option to discard 2 cards for +$2, afterwards (if you chose to use the previous option or not) the option to pay $2 for +2 Cards.
The game wants to minimize your clicking, so
a) if you have 2 cards in hand and $2 once the options start, you are given both buttons. That way, if you want to only use the "pay $2 for +2 Cards" option, you don't have to explicitely decline to use the first option, you just click on the second button and the game interprets that as "don't use the first option".
If you want to use the "Discard 2 for +$2" option, then click on the button, and you will be given the option to use the "pay $2 for +2 Cards" option afterwards.
b) If you lack either $2 (and also have no Coffers) or 2 cards in hand, the corresponding option will not be initially given. This is the situation in your first picture (no $2). If you lack the $2 but have the cards, after discarding you usually have the $2, so "pay $2 for +2 Cards" option will be given afterwards (but you didn't discard in your game).
c) The game generally does not go from one phase to another "during the middle of an effect". In your second picture, if you discard 2 for +$2, you have $2, could pay it for +2 Cards, and continue with playing Actions if you drew Action cards. But if you don't want to discard, your Action phase will end, as you can no longer do anything in it (no Action cards in hand).
That's why the "Don't" button appears in that case. The game could show the "End Actions" button, but for some reason does not do that and uses this "Don't" button for you to indicate "No, I don't want to use any of the given options, please end Capital City now".
The game wants to minimize your clicking, so
a) if you have 2 cards in hand and $2 once the options start, you are given both buttons. That way, if you want to only use the "pay $2 for +2 Cards" option, you don't have to explicitely decline to use the first option, you just click on the second button and the game interprets that as "don't use the first option".
If you want to use the "Discard 2 for +$2" option, then click on the button, and you will be given the option to use the "pay $2 for +2 Cards" option afterwards.
b) If you lack either $2 (and also have no Coffers) or 2 cards in hand, the corresponding option will not be initially given. This is the situation in your first picture (no $2). If you lack the $2 but have the cards, after discarding you usually have the $2, so "pay $2 for +2 Cards" option will be given afterwards (but you didn't discard in your game).
c) The game generally does not go from one phase to another "during the middle of an effect". In your second picture, if you discard 2 for +$2, you have $2, could pay it for +2 Cards, and continue with playing Actions if you drew Action cards. But if you don't want to discard, your Action phase will end, as you can no longer do anything in it (no Action cards in hand).
That's why the "Don't" button appears in that case. The game could show the "End Actions" button, but for some reason does not do that and uses this "Don't" button for you to indicate "No, I don't want to use any of the given options, please end Capital City now".