Before you start any thing remember to back up your template in case something goes wrong.
From the previous post we can get the code that we used to add AdSense ads in the middle of the post.
<div style='clear:both; float:right; margin-left:5px;'>
<!-- Your AdSense code here -->
<b:if cond='data:post.includeAd'>
<data:adEnd/>
<data:adCode/>
<data:adStart/>
</b:if>
</div>
Now you want to apply third part ads or some other content. Lets make the changes.
<div style='clear:both; float:right; margin-left:5px;'>
<!-- Third party Ad code goes here -->
</div>
Add your third party ad code just after the Third party Ad code goes here. Even a JavaScript should work without any problem. However, for some reason AdSense code directly from AdSense code generator does not work. All the other codes work fine with this way.