Pretty slick stuff. Fair warning: your "sed -i.bak" lines are only going to wind up with the next to last version backed up since each update to sshd_config will overwrite the last sshd_config.bak.
You could chain all the sed changes together into one command (tested on Linux, OSX's sed might need some tweaks):
sed -i.bak 's/^#\?\(\(ChallengeResponse\|Password\)Authentication\).*$/\1 no/' /etc/sshd_config