I suspect that the Prf API is not really good at compressing the INI file, if keys are removed, truncated and/or subsequently enlarged. The only thing that will then (hopefully) help is to actually create a new INI file.
INI files have no dead entries, slack space, etc. so rewriting the files will have no effect.
The only solution for an oversized os2.ini is manual maintenance. There is no way for an automated tool to know that a given entry belongs to some app that you deleted 2 years ago. Only you know that, so only you can make the informed decision to delete it.
Open an INI editor and scan the list of "Applications" (the top-level key) for entries that are clearly obsolete, then delete them. Next, look for stuff you seldom use. Often the only key associated with the application is "WNDPOS" or "WindowPos" which (as the name says) describes the position and size of the app's main window. If so, delete the application (not just the key) - when you next open the app, its window will open at its default size and location. Do NOT touch any "Application" whose name starts with "PM_" or "PMWP_", or for that matter, anything you don't recognize (often the names of the keys or their data will help identify the origin of an entry).
One tool that may help a bit is my 'Iconomize' util which displays an app's assigned icon and its default icon side-by-side. If the two match (or you don't care about the custom icon), delete it. This can save 4-11k per entry.
BTW... don't even think of editing 'os2sys.ini' manually.