Hello rudek! I really liked your work, but there is one detail that I did not understand, it is"execute console command "effect clear %player%"" on line 58.
You could write - "remove <effectid> from player" instead of the "effect clear" command, and instead of numerous repetitions of commands do the following:
loop 60 times:
if {logged in::%player%} is true:
remove <effect> from player