Apologies, maybe I phrased my first reply a little ambiguously.. You're right in that the while loop will re-check if freeFish is null with each iteration, but my point was that freeFish will never go to null, because you initialise it but never update its value. This is the same reason that the following code will be stuck in a permanent loop:
int aNumber = 5;
while (aNumber != 0) {
system.out.println("aNumber is still not 0!");
}
In the second part of your reply, you seem to hint that looping through the whole script just to check if there are some fish to pick up is a bad thing, when in reality, that is exactly the situation we want to be in. Regularly checking the game state and acting on it is the best way to make a responsive and reliable script, and the best way to achieve this is to have onLoop being called very frequently, with all game interaction being non-blocking.
It's hard to explain but it comes with practice: keep at it and your understanding will grow
You're doing great so far
-Apa