You could simply include a count variable in your loop, and if count == 5 then display ad code.
after displaying the ad code you
That would call for the ad every 5th result, which would be useful if you want to continue displaying ads.