Not exactly sure what youre trying to say, but first of all chmoding halt shouldnt make it possible for all users to shut down, you have to edit /etc/sudoers /* think thats it */. Secondly, I assume you mean a script to leave runlevel 4 and X and then shut down? If so it would look something like this
#Custom shutdown script
-Hope this helps.