Prevent OS X from powering off, via CLI
How about actually using a GUI app to make an unsaved document?

osascript -e '
    tell application "TextEdit"
        activate
        set d to (make document)
        set text of d to "Your script is still running!"
    end tell
'