Sounds like you’ve already handled the hard part.
If you can detect and intercept the animation that’s playing, then all that’s left is to notify EDI so it can trigger the corresponding script.
The official EDI HowTo topic has helpful information and client examples:
You can also look at existing game integrations for reference, though you’ll likely need to adapt them to work with Python for Ren’Py.