8 Billions of gigabytes necessary RAM. Nice...
It just doesn't make sense getting this to work honestly, you should serioulsy revise your base design otherwise you won't be able to make your project work except on a specific dev machine.
You don't want people to comment, but at the same time you are requiring help, so please, take that comment as another help feature.
Now for your issue.
To get back to "On animation ended", you can simply not make the animation loop and use the action "Animation - Start from beginning" to make it play again (be sure that the animation is not set to loop). That's how you manually handle a looping animation.
I must admit otherwise that I have no idea what your issue actually is.
What do you expect your project to do and what is effectively happening ?
According to what I can gather from the code, this is working as programmed. So I don't get where you are having an issue.