hmm can you not sort it by assigning actions to individual animation frames within the editor itself?
I'm a little strapped for time at the minute for providing Lua examples - currently in the middle of designing a website for a client which I've to finish in the next couple of weeks.
I can tell you however that what you are thinking of with call script wouldn't be the way to go about it.
we'd use a definition script so we could set up some functions for checking either via an event listener/handler or by using the execute a script action part or a combination of both.
I'll have a go at uploading those screenshots to my previous message & see if VS community feels like playing ball now.
*edit: and apparently it still doesn't seem to want to let me!
go to your character animations & click on a frame you want to assign an action to & then look for the edit frame button on the editor above the animation preview section & then assign your actions via the "action" section on the bottom left of the animation edit box that popped up. Simpler than using Lua; if you don't understand it very well or at all