How to regulate current to my house
Your idea for a large battery backed up UPS that is charged by the power company would be the best solution (most ups systems do provide lightning protection). The size of the inverter would need to be based on your peak load plus a safety factor to prolong the system life. The battery system really would need to be 2-3x to prevent damaging the batteries during discharge I have seen large forklift batteries used in a similar case but longer discharge cycles were needed. In some cases changing the size/ type of main panel can reduce load based flickering, installing a bolt to bus panel where the breakers are bolted directly to the bus reducing some of the voltage drops in the system. The last part would be to request upsized conductors from your service point and possibly change from a conventional meter to CT meter. CT meters take a field reading off of full size bolted conductors where standard meters are like big outlets that the meter plugs into and cause voltage drops, these conversions to bolted connections may help quite a bit I have seen it reduce problems in a medium sized load center on a commercial service.