Perhaps it helps someone, so I described how I got it to work:
I've tried the instructions from Jun 2016 from @ccstone
But I was always told AudioSwitcher not found.
But installing https://github.com/deweller/switchaudio-osx via homebrew and then using this shell script (modified from @ccstone to use SwitchAudioSource and my own Sources) as a KM action worked:
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH;
currentOutput=$(SwitchAudioSource -c); echo $currentOutput
if [ "$currentOutput" = 'MacBook Air Lautsprecher' ]; then
SwitchAudioSource -s 'Externe Kopfhörer'
else
SwitchAudioSource -s 'MacBook Air Lautsprecher'
fi