I assume you mean that you want to make it like Modern Sonic's?
First of all,
P_HomingAttack() would be a necessity. It's a Lua function that allows an object to home into another object.
The result of
P_LookForEnemies() can be stored into a variable (i.e. mobj.target) for later use.
Of course, if you really want a pose to happen after a successful homing attack, you have to know how to get two "hooks" to communicate with each other. The best hooks to use for this piece of code (in my opinion) would be
PlayerThink and
MobjDamage. The former is per-player logic, and the latter executes whenever an object (i.e. a Crawla) is damaged.
It may look intimidating at first, but it's a pretty simple concept. Remember, all Lua-related things are documented on
the wiki. If you need help understanding stuff on it, feel free to ask.