After some help from the BusyBox maling list, I've found that any output, even the stdout, is suppressed during the shutdown, but the script is executed. I don't know if there's a way to write an output on shutdown. Maybe I can use
acpid to run a script when the power button is slided.