Bash script for /etc/crontab
The script errors because you have split the command in two lines. Basically you want to remove the newlines between the PATH and the kextunload lines, so it looks like this:

#!/bin/sh
PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin kextunload /System/Library/Extensions/AppleHDA.kext
echo "Internal Speaker disabled"


But you could also just simplify all that down to a single line you can put in crontab:

/sbin/kextunload /System/Library/Extensions/AppleHDA.kext


When you add the cronjob with crontab -e then add it like this to get it run at every boot:

@reboot /sbin/kextunload /System/Library/Extensions/AppleHDA.kext