This message was posted on behalf of Intel Corporation
I have never tried to do something like this, however I believe it's possible since I found a few possible answers for this question in:
Nevertheless, I have another idea. You could create your own command that executes the script you would like to run and then shuts down the Edison. This is actually very simple, just create a file in /usr/bin with a structure similar to the following:
from subprocess import call
call(["RUN YOUR SCRIPT IN HERE"])
As you can see the command code is written in Python, it has a system call so you can run the script you would lie to run before powering off and when it finishes it shuts down the board. Once you've written the command, give it executable right with chmod +x YOUR_COMMAND and then you should be able to run this command any time.
In case you don't know how a system call works on Python, you can check the following link to learn more about it: