Ooof, I remember this bug. I can't tell you exactly how to fix it, but I can describe it to you generally.
Basically, there's a list variable named event_list (line 187, in scripts/freeroam/episode9/ep9_freeroam_diks1.rpy) It's used to queue up events at the party. If you're stuck in a loop, what's happening is that an event is being repeatedly added to the list.
The solution is to either search the renpy script files to find when that event is being added and delete that line of code, or use the console in-game to view the event_list variable and remove the repeating event at a transition point.