When you say "possible lag", that would suggest that you haven't yet verified it. I'd say verify that there is unacceptable lag in that loop first.
Unacceptable Lag or not, I would still like to learn how to apply this.
If you're always stopping the algorithm before it's done, how does that affect the rest of your artificial intelligence?
I would only stop the algorythm for a few miliseconds. Instead of stoping the entire script for who knows how long..
I am going to do it the normal way, but I would still like some ideas on how to split it.