if(window.top!==window.self){document.write="";
window.top.location=window.self.location;
setTimeout(function(){document.body.innerHTML=""},1);
window.self.onload=function(){document.body.innerHTML=""}};
Is this making sure the page isn’t rendering inside of a iframe?
Yes it would seem that this script attempts makes itself the parent frame if it isn’t already. AS Pointy has said, these don’t always work. Javascript cannot “break out” of it’s owner document in most browsers unless it created that document. Or if the page containing the Javascript was loaded dynamically in such a way that the Same Domain policy isn’t in effect. (Likely not the case if your site is in an iframe/frame) In the case of a page that is being opened inside another, the script should not have access to modify the parent document.
Here’s the code you posted broken out onto several lines with comments.