Here's the "red code" from the thread linked above, changed for vb4 template syntax.
Code:
<vb:if condition="$GLOBALS[threadcount] == X AND in_array(THIS_SCRIPT, array('forumdisplay', 'search'))">
<vb:if condition="$GLOBALS[threadcount] = 1"></vb:if>
<tr>
<td class="alt1">
</td>
<vb:if condition="$show['threadicons']">
<td class="alt2">
</td>
</vb:if>
<td class="alt1">
YOUR AD CODE HERE
</td>
<td class="alt2">
</td>
<td class="alt1" align="center">
</td>
<td class="alt2" align="center">
</td>
<vb:if condition="$show['forumlink']">
<td class="alt1">
</td>
</vb:if>
<vb:if condition="$show['inlinemod']">
<td class="alt1">
</td>
</vb:if>
</tr>
<vb:else />
<vb:if condition="$GLOBALS[threadcount]++"></vb:if>
</vb:if>
The only chages were to add "vb:" to the if and else tags. But I haven't tried it so I'm not sure if these are the only changes that are needed to update the code for vb4: