As I am aware of there is no defaults command for determining the state - but if you know the command and what it does you can help yourself like the way I described it in my first reply.
Thanks @Nige_S - learned something new while drinking my first morning coffee and appended my note in Quiver with that defaults read command instantly
@MikeMcC - I would combine this new command with the approach I posted yesterday with an enhancement of receiving input - which will give you the ability to run it as submacro whenever you want to
This is just an idea you can benefit from - since my time is currently over I can not give you the macro today … but maybe you have enough input for now to create it yourself.