The directional movement custom events are not needed for it to work.
It checks if the keys are pressed, and sets "Move X" and "Move Y" based on that.
Then it sets your speed based on "Move X" and "Move Y".
Then it sets your animation based on your speed.
All of that within the update event. But see how it checks "Use Controls" before looking at if the keys are pressed? That's only the normal flow for the behavior attached to an actor that responds to player input. What about an NPC? Since an NPC won't check for input, you can move it by instead calling the four directional movement events yourself.