Something Like this, You would add the /console Sound_EnableSFX 1 when you want to turn it back on. There is also the Sound option in game or are you looking for a macro so you can turn it off without having to go there.

CTRL + S turns off all sound or just Ambient sound can't remember.

#showtooltip
/console Sound_EnableSFX 0
/cast frostbolt
/script UIErrorsFrame:Clear()