Came here to complain about this specific level for this specific reason only to find out that it's already been addressed.
I've tried this level 18 times now and can NOT get the rhythm down for this level. So far, I've been able to get close enough to the folder for it to open exactly once, then immediately fell because I was a tiny bit too busy celebrating.
I do think that the OP's solution is perhaps the best one: Make it to where you only need to keep the duck onscreen, thereby allowing players to take whatever path they want to. This is actually what I originally thought the solution was after reading the code, which reads "When PLAYER is looking at the duck". I am the player. The grey dude is the character. Admittedly this will make the bug trivial to obtain, but perhaps you can implement a render distance and put the bug out near the edge, requiring timing