Yellow for taking of shirt only after goal scoring?

A player must get a yellow card if he removes his shirt or covers his head with his shirt. Even if he already got a yellow card.

But there’s some extra information in Law 12 in the Laws of the game. It’s all in case of the ‘celebration of a goal’ (the name of the header on page 116).

What will you do if a player puts of his shirt when he walks to the sideline because he’ll be substituted? Would you do the same as the referee below?

Player involved is Samuel Inkoom from Dnjepr Djnepropetrovsk in the game against Karpaty.