The switch in question is just checking an enum so it’s fine. Generally you want to avoid doing things on Tick, but sometimes it can’t be avoided. If it can be part of an event or be done on a timer it’s much better than using it on tick.
Switches on string are terrible for tick, though. You just need to think about how long it takes to resolve something to a boolean - checking a byte against a byte (enum) is super quick while checking an array of bytes against another array of bytes (as in a string) is exponentially more expensive.