I don't see a way of conditionally disabling the shake tag.
You might be able to do the shaking as a custom effect instead, and turn that effect on or off in the code that implements the effect.
Or you could construct the RichTextLabel's text property dynamically, using variables that hold the [shake] and [/shake] tags, and set those variables to empty strings to disable the shaking.