A mains-synchronised inverter is not a DIY project, by any means. The slightest error in synchronisation and things get very dangerous and expensive!!
A safer (but still dangerous) and more practical way I can think of achieving something like that effect is to charge the battery pack from normal AC power, but to feed the battery DC back across the existing solar inverter input (where the solar panel array connect) via a switched-mode system, with voltage control to balance the proportion between that and the solar panel array.
It would require two external power diodes, one from the solar panels and one from the inverter, in line with the respective (eg.) positive from each source, to the inverter DC input.
Increasing the voltage slightly will allow the inverter to draw more current, with the solar panels still providing almost the same power.
Best still - you can get solar inverters with the built-in facility to either run from, or run from and charge, a battery bank. Your 24 cells works out at around the same range as a 72V lead acid system.
I strongly advise that you never disconnect the current sensors that are part of any PSU or inverter, they are also part of the safety system and an external device response would be too slow.
Some monitor current on a cycle-by-cycle basis and any delay could cause massive instability.