if [ -x /usr/local/bin/networkchange ] ; then
/usr/local/bin/networkchange
fi
The only command that follows this addition is the exit 0 from the original script. You could put all your new commands into the original set-hostname, but it is easier for me to remember the script is in /usr/local/bin with all my other custom scripts. Don't forget to create a backup of the original script in case you need it later.
The script that I created does a bunch of different things based on the Network or IP address that the Mac is currently using. Things like mounting file systems, adding static routes, etc.

