My opinion...
Generally depending on software control for tasks that can result in damage or injury is a bad idea. Too many things can go wrong "one time in a million" that you don't expect. Especially with 'high level' software running on an OS.
You should ideally have electrical interlocks between the mounts and the roof controller. The mounts should signal when they are parked safely and then allow the roof to move.
Software can initiate the actions and monitor but it shouldn't be your only defence against disaster.
There's not a simple 'one size fits all' solution. You need to treat your setup as a whole and look at possible failure modes. A large part of this will come down to how you are controlling the roof.
Thanks Ed, I already have a area sensor that prevent the motor from running if the mount are not fully parked. But still, the ability to custom, delay or change the order of the shutdown procedure is really handy to have.