Special functions are implemented in boxes, like delays, counters, etc.
My task back then was to feed the entire I/O state into a ring buffer, and when a "crash" of the steel mill happened, a host PC could then download the entire buffer, giving access to information about what happened in the seconds BEFORE the crash.
It would be fairly easy to port to the Arduino, if someone hasn't done it already. Yep - it's been done https://cq.cx/ladder.pl
Because Ladders are text based, you could use Teco/EDT/Vi/Emacs/WordStar macros on them.