Welcome to AUGI and congrats on your first post.
I have always used a command reactor for causing commands to fire when inserting a block.
Code:
(if (not Command_Ending_Reactor)
(setq Command_Ending_Reactor
(vlr-command-reactor
nil
'((:vlr-commandended
.
Command_Ended_Command
)
)
) ;_ end of vlr-command-reactor
) ;_ end of setq
() ;_ the reactor is already loaded
) ;_ end of if
then I define my command ended command with the in reactor name and the in command, and compare the in command to the command I am looking for, in your case "insert" or "-insert" If it matches, it will run the program.