You would probably be better served to explain what you're trying to do; what problem you're trying to solve. Your pastebin code isn't valid JS, you can't open a window and inject a script on that window (for obvious security reasons). Also, try posting at stackoverflow.com/ as it's more specialized for code help like this.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
You would probably be better served to explain what you're trying to do; what problem you're trying to solve. Your pastebin code isn't valid JS, you can't open a window and inject a script on that window (for obvious security reasons). Also, try posting at stackoverflow.com/ as it's more specialized for code help like this.