As of version 2.3.9, AiO allows the user to set up repeating events with no end date, and the UI shows that the event will repeat "forever." However, as we found out the hard way, "forever" only means three years, after which the repeating event no longer appears in the calendar.
AiO should allow the user to set up a repeating event with no end date using a single database entry (not one for each instance of the event), and such events should repeat indefinitely without any intervention by the user.
The ai1ec_events table has a column called "recurrence rules." The "forever" repeating events don't have an "UNTIL" parameter. Your code could simply test for the existence of an "UNTIL" parameter, and if there isn't one, output to the calendar indefinitely. It seems like you are practically there. That's just a suggestion; there are probably better ways to implement this.