Flash Selected Enemy bug

Welcome, i have been trying to use `Flash Selected Enemy` by `modern algebra` and as other users i have met error where game after some time just...freezes, like not progresses at all.
I tried to fix it myself but i couldn't see why it happened so at max i can show where exactly game stucks

i don't know if it's cus several scripts adds methods to that part of code or other stuff but console does show it so it's my only hint

Original thread: https://forums.rpgmakerweb.com/threads/flash-selected-enemy-bug.177215/