Finally found a readable way to toggle the mute status in MS Teams:

With an action “internal: Run shell path (local)” I use

%SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe "$procid = Get-Process | Where-Object { $_.MainWindowTitle -like '*Microsoft Teams*' } | Select-Object Id | select -Expand Id; $wshell = New-Object -ComObject wscript.shell; $wshell.AppActivate($procid); Sleep 1; $wshell.SendKeys('^+m'); $wshell.SendKeys('%+{TAB}');"

(MS Teams only accepts keystrokes/shortcuts with focus on (one of) its window)

Companion User Group posting