refactor: abort/continue/undo scripts

@kevgo Set script name and error messages based on the command running instead of having to hardcode it with strings.
I haven't tried it, but can you inline the `actions` variable, as described here: http://tldp.org/LDP/abs/html/loops1.html ?