You have the general idea, yes.
While there are no tools that will prune old PMs, we do have a rebuild utility that is designed to restore corrupted PM indexes.
The code is very basic, but it should be easy to modify it to delete PM files that are no longer indexed rather than simply ignore them.
This code is entirely unsupported by Infopop. No guarantees. It may well end up turning your UBB into strawberry jam.
If you'd like to get your hands on it, please open up a support ticket and include the URL to this topic and a request to assign the ticket to me in the message body.