Hi i have some steps to do befor it works
step 1. do /give @p command_block
step 2. copy the first command that is ther and paste it into the command block
step 3.then put a redstone comparator sticking out of the command block then a redstone Repeater sticking out of the comparator
Step 4. then put a redstone clock thats runing into the first command block
step 5: place a command block were the repeater is and copy the second command and paste the command into the command block
step 6: when you whant to execute the mob around you go on the slot 1
step 7: we are now don and i hope you like it :)