AutoHotkey functions are a true gem that help streamline your code, make it more readable, easier to maintain, and avoid conflicts with other variables (because their scope is local by default. They take a little practice getting used to however they can save a ton of time and allow for re-using a ton of code. Don’t get hung-up on writing them at the beginning of your script. Often I go back after writing my script and realize I should have written a function in place of a subroutine.
My first video on AutoHotkey functions explains why & how you can use them.