How whould i organize this script?

You can modularize it like so:

1 Like