Auto bed leveling only when powering up

I have seen somewhere someone put auto bed leveling in a macro, but did not quite get it.

Is it possible to somehow during the start script, detect if this is the first time the script is run since power up, and then let an IF statement control auto bed leveling, so it is only done once after being powered up?

It would save a lot of bed leveling time, and if you need it again, you simply power the printer off and on again. The head wiping could be kept running at every print start.

According to this:

http://marlinfw.org/docs/gcode/G029-abl.html

Skipping bed leveling after the first one following a power up, can be achieved by simply adding an “O” for optional to the G29 command in the startup script:

G29 O

Anybody know or tried this?

… so for FW 1.1.9 I am thinking that instead of

M420 S0
G29
M420 S1

instead it would just be:

G29 O

as there would be no “compensation stack up with bed leveling” mentioned in the release notes https://code.alephobjects.com/w/cura-lulzbot/ due to the “O” parameter?