Interactions Script in Head Necessary?

Hi,

Created a scroll to top icon that slowly fades in when scrolling down the page and fades out when scroll to top with Pinegrow interactions. I get a block of JavaScript in my <head>. Is there a particular reason to keep it in the <head> or can I move it down to the bottom of the page or better add it to my external js?
Or is it only there to be able to edit the animation?

Regards & Thanks,

David