An UNO command is needed for the 'Hidden Text' checkbox found in Tools > Options > Writer > Formatting Aids. Hopefully these code pointers are of use.
A similar UNO command is already available for the 'Fields: Hidden Paragraph' checkbox (.uno:ShowHiddenParagraphs).
The new UNO command will be added to the View menu in a grouped section with Formatting Marks (.uno:ControlCodes) below 'Track Changes'.
Similar to 'Fields: Hidden Paragraph' (.uno:ShowHiddenParagraphs), hidden text should be made independent from 'Formatting Marks' (.uno:ControlCodes) so it can be shown/hidden irrespective of the state of 'Formatting Marks'.
'Hidden Text' is mentioned in Bug 107658 and help says:
"Displays text that uses the character format "hidden", when View - Formatting Marks is enabled."
Is this bug about 'Fields: Hidden Text'?