Better smarts on discharge of the UPS can help. Most of them currently let the battery pack fully discharge, causing irreversible damage to the battery pack, especially if power isn't restored quickly. A setting for cutting out at 40% depth of charge would prevent damage to the pack.
Over provisioning the runtime on the UPS can help if you can afford the extra upfront cost.
What someone really needs to do is make a UPS that just attaches to a standard deep cycle battery, as those can be easily sourced locally pretty much anywhere and one can pick the battery to fit the application, rather than be stuck with the crap batteries the UPS manufacturer decides to use (they typically use high C batteries which do not like deep cycling).
I don't believe that in a situation with wildly fluctuating power there is any alternative to "grab all available energy from the grid when there is power", you never know how huge the next brown/blackout will be.
What could definitely help is putting good power conditioning equipment in front of the UPS. That at least will protect the AC-to-DC first stage from overvoltages and shorter brownouts. If the PCE comes with fat enough supercaps, it can also protect the main UPS by preventing it from draining the battery at all.