I can not do this right now Chuck. I apologize.
However you can see this post from @OttoKerner to see what I’m talking about (orphaned accounts being retained in the database after being removed from Plex)
He knows how to do it. Perhaps you could collaborate about implementing a cleanup of this in your new program? Thanks for your work.
Edit: the option could say something like “prune orphaned users” and your program could cross check with Plex cloud which users are currently added, and prune the rest (orphaned). This should obviously not be included in the auto mode, but it should be safe in general.