is it possible to put a "for loop with break" into a function ?

You could instead create a macro, since those can have multiple in/out execs.

Or you could just have your the event set a bool that cuts it off inside the function with a branch.