Basically restart the modem by cutting the power every time the connection is flaky. With a very complicated setup. Cutting power repeatedly a large number of times is a great way of eventually bricking the box. This modem has an admin web interface. The author could have used it to trigger a restart. The whole thing could have been automated with just a pi at 100 times less cost, effort and risks.
The LAN interface on my ISP mandated box frequently fails along with whatever else is going on with the modem. Even the reset button fails at times, though not as often. Cutting power is literally the only reliable way of addressing the problem
I don't agree that a hard rest is as risky as you are claiming, but even if you are right, who cares? The ISP mandated use of a shiity modem, they made it a black box that can't be troubleshooted and if it breaks then they will just send me a new one at zero cost to me.