Yes, you could delete that section, but I can’t promise that will fix the issue. Since it doesn’t appear to be a theme issue, that means that someone somehow has or had access to your account in some kind of way. So if they’ve added code into that file before, I’m not sure if they’ll be able to repeat it or not. I would reset your passwords and check any outdated plugins to make sure everything is up to date. This is definitely an unusual thing, and I would take immediate action to try and at least prevent it from happening in the future.
I create awesome sites for awesome people! Contact me if interested – firstname.lastname@example.org