There are mods for this. If you have a real, active vBulletin licence, go to vbulletin.org, and find it under the mod tab.
Assuming you're using the built in advertising just replace this in postbit <vb:if condition="$show['first_ad'] AND $post['isfirstshown']"> with <vb:if condition="$show['first_ad'] AND $post[postcount] % $vboptions[maxposts] == 2">