"checkforevents" is a variable in the mansion that essentially indicates whether the mansion should attempt to check for and display a new event. In practice, this value is only true while an event is being displayed, but it will be blocked from checking for new events until the first frame where the current event is no longer visible on screen. Thus "func nextdayevents" will be repeatedly called until the end of the function is reached without triggering an event.
The player gives birth first, followed by slaves giving birth in the order that they appear in the mansion list, followed by scheduled events, followed by random events, and followed by main quest story scenes. This order of presenting events is always maintained, though not every type of event occurs in a single day.
A new system was being planned to handle events in a more centralized manner, but the person contributing that code abandoned it for whatever reason. So the new system was removed from operation and the game uses the old system for events.