It does not work like this. The killall commands after the sudo command will not run as root. But it should not be a problem, since hildon-home and hildon-desktop run as user, so there should not be a problem to run those commands as user as well.
#! /bin/sh /usr/bin/killall hildon-desktop /usr/bin/killall hildon-home