There is a different way to control the history stack, it is not what you wanted but it is a different option you should check out.
In Properties (or Default) when you right click the top left corner there is an option "Discard Old Duplicates" tick it and the stack will change its behavior.
in your example performing "A", "B", "C"
. and then twice up to perform "B"
, the stack will look:"B","C","A" (first up will be "B")