Hm, very unfortunate. Your document seems to be a mess…
You really have to check every single character. In case of empty text frames or empty cells in tables even the one and only insertion point present. Maybe it's "enough" to check textStyleRanges, but in case of GREP Styles and/or Nested Styles in your paragraphs, even that could be a problem.
Without seeing the actual document it's very hard to suggest something.
To see, if a single insertion point, a single character or a text style range is overridden, you could check for:
But this is not giving you the details, only a true or false on the fact.
And of course, there might be good reasons (from the designer's point of view!) that a paragraph style or a character style is overwritten. How to account to that is also a question, that cannot be answered easily (or at all using a script).
Ah cool. Thanks a bunch for your reply! So, if I'm understanding this correctly, there is no specific property I can access on ParagraphStyle or CharacterStyle that'll give me all the overridden properties. I can only use "styleOverride" to check whether there is an override or not, correct?
Basically yes, you have to look at every character or insertion point to get the properties that are overridden, if you compare them to the applied character style and applied paragraph style. It will get really nasty, if there are a lot of GREP Styles applied. Or nested styles or nested line styles…
But Jongware and Marc Autret once found another method "under the hood" (not available in the GUI for the ordinary user) to visually depict, if there are style overrides ("local formatting"):
For that see:
Show Local Formatting in InDesign CS4/CS5
The Hidden Way to Highlight Styles
May 10, 2012