Internally, we have a Ruby script that runs over all files (dialogs, items, characters, translated strings, ...), extracts the texts, puts them in a database, unifies matching texts from the same context (e.g. two times the same string in dialogs belonging to the same mod), assigns UUIDs to them, and then replaces the s_HandleUnknown values everywhere with these handles.
This script is indeed not included with the downloadable tools. I'll check whether we can release it, but it would probably not be very easy to set up in an outside environment.