This is what I do if there are very less commands but a high health monster. Just add random(or blank) commands after the thing. I think 2-3 would suffice below each command. This gives you time for the quest to turn in, hence it kills till you have the thing again before leaving the room.(Just like in my VKS pet bot.(except the makais as I added a command that wasn't needed.))