Help with conditional script using input boolean

Hi

I have IR audio receiver(broadlink) with two audio source (TV/Chromecast Audio). I have option to change input left and right (next/previous). So for example the based state is TV audio, if I triggered “script TV audio” it will check if input already on TV using input boolean (maybe?) it wouldn’t do any action or a action that doesn’t effect input like a TTS on google mini saying it already set to TV audio.

I won’t be using remote/input button to change source, it all going to be done through hassio. So I can make sure input state will be correct, even if it incorrect it can easily set to correct is it ever happens. As the button is tapped off and remote won’t be accessible.

I am not exactly sure if I should use script with combination of automation or just script with conditions?

All switch has been mapped and working correctly. I have currently command_off and command_on with same command or should I just have either command_on/command_off

Thanks