How to tell when OH has finished startup

You can approximate.
You would need to clean up the openHab2 startup process and make sure that the .rules files get loaded as the very last step of setup.
Next you need a way to define the sequence of loading rules
Then create a rules file that will get loaded last and give it a rule “triggered by system start”
that sets a Flag or flips a switch or whatever you need at that moment.

There was a discussion how to cleanup the start process in 2018 and Cleaning up the startup process / renaming rules (windows possible) - #9 by ptweety has a solution for that which has worked for me nicely ever since.
In a nutshell, all rules files get renamed to another extension before openHab starts (except one) and then you have one rule rule that is still active. When it is called openHab is still in the middle of everything so you start a timer here, 3 min worked good for me. When that timer fires the changed filenames get named back and openhab will load them one by one after that.
Now you can implement a naming scheme for your rules like
100_sensor.rules,
200_PIR.rules
,
999_last.rules

Bash will rename them in alphanumeric order and openHab2 will load them in the order bash renamed them. 999_last.rules will be the last file to load.

Let me know if you’d like more details