I don't think it will be problematic if you flag by individual dialog responses, and add some special but simple exceptions that make a response never be flagged:
- The response contains a script or global var (I think this is possible to do?). Even though this probably almost never happens. No need to check for generic stuff that won't ever change like %PCRace, etc. You may or may not want to treat the NPC's attributes (class, race? name?) as an exception, which will effect whether topics like Background can become grayed out.
-The response contains a script or global var or certain functions in the result, such as: Choice, AddItem, RemoveItem, Add/RemoveSpell, StartScript, StopScript, AI functions, rank modifying functions, journal modifying function...
I guess you could even blanket if you want by checking for any function at all in the result, or even a non-empty result (after all, even that drastic filtering should catch all the generic lore responses anyway).
That thread mentioned simulating and comparing the text of the response to previously-heard ones. I imagine this could be done easily by adding a list of CRCs of every heard dialog text to the save, or something to that extent, though I can't imagine right now how this would be better than the aforementioned behavior, maybe I'm missing something. At any case, I'm not sure why you'd need to store info with the NPCs/creatures themselves at all.
Lastly, even though I think I covered dynamic, remember, even if a topic is somehow grayed out accidentally, it doesn't mean it's removed, and it isn't the end of the world. Also, and it would seem to be true of others as well, when I say "grayed out" it doesn't mean literally gray and looking disabled-ish, like a button in Windows; we use "grayed out" as a shorthand here for a different color shade (think of a visited hyperlink).
I don't feel the scare of making this a post-1.0 feature, since it'd be turned off by default and only enable-able through config editing, anyway.