Both interesting questions, but not actually relevant to this.You play advantage on a reckless challenge. You then forget to show him a yellow card or let him know at the next stoppage. 10 minutes later you remember. Do you then show him a yellow or just tell him? Or neither. Is he now on a caution?
What if you only remember after he commits another cautionable offence? Did the first caution happen?
I know it's not entirely the same as the OP, but it illustrates 'counting' a caution that was not communicated is a slippery slope. There may well be cases that you should count/record them, but OP or my examples are not one of them.
This is a player who has committed dissent, has been told he's committed dissent and has then escalated. Best course of action would have been to show the yellow then the red (possibly with additional hand gestures to clarify), but you don't get to ignore stuff that happened before a red card just because your top priority in the moment is getting a player who is acting aggressively towards you away.
Again, the core point is that showing a yellow card is only a tool to help clearly communicate a caution - it is not a requirement for a caution to have occurred. The caution occurs when and to who the referee believes it has occurred, anything else (telling the player, writing it down, showing a card) is ancillary to that initial moment. And I'd be happy to discuss how that affects your theoretical questions in a different thread, but it's only going to cloud the issue if we go deep into irrelevant hypotheticals here.