If I was going to do something like this:
I would have as relay or solid state device which provides power when a logic signal is high.
This logic signal will be OR'd from two signals. One would be a time delay, which is started by an ON push button. The time delay will keep the soft switch closed long enough for the RPi to boot, and a script to send a signal out on a GPIO line to keep the soft switch closed when the time delay runs out.
Thus if the RPi fails to boot completely the power will shut off automatically.
On power down the RPi will run a shutdown script the removes the GPIO signal. The signal will be held for a short delay, and then the power switch will open cutting the power. The delay will be set long enough to allow a normal shutdown sequence to reach the system halted state.
For more sophistication you might make the GPIO signal only momentary, to reset the power on delay timer, say for 1 minute, and have a watch dog script that runs on some sort of interrupt timer, which is less than 1 minute. If the RPi hangs for some reason, the watchdog timer won't reset the delay and the power will be cut.