No such property is exposed for scripting, unfortunately.
The one to observe is a menuAction.name ==> but this is only an effect of some procedure involved by menuAction. Even worse ==> script will show you the last menuAction status - not the one is currently applied to activeDocument. It will update after menu activation in UI, not earlier.
So you can only toggle between both of them regardless on its current state, using app.menuActions.itemByID(24332).
If you will try to check (by script) its current menuAction.name ==> sometimes is true, sometimes is false.
If you will check it manually ==. is true cause is updated already.
I found that the script is showing the last menuAction.name but not the activeDocument's menuAction.name.
Do you know how can we update the menuAction in script?
Yes I also found that, I think thats a bug, need to manually click the show texr thread again, the name can update
Property is hidden for scripting and this could we call as oversight (not the first) rather than bug.
MenuAction name is updated while displaying and this is correct, I guess (for UI user). Its parent is application. MenuAction can invoke some set of actions depending on values of some properties (vary for each document).
Script can talk with InDesign about many document's but only one application at the time. So hidding a doc.property for scripting shut it down.
Only way is simulating UI actions but there is many limitations for this.
Plug-in developers can go deeper, I think, but they talk in another language...