We resolved the issue by creating separate content file for Content Editor Web Part. The content file is linked to the Content Editor Web part. As the "document.write" is moved to separate file, for every request the file is read and parsed for render. "document.write" do not append content in the file. So it has no duplication of content.