Functions in AutoHotkey are a great tool to have in your bag! They can definitely help simplify your code, ease re-purposing of code and avoid a lot of simple mistakes by keeping the variables local (instead of global). AHK Studio is an editor written in and for AutoHotkey. It helps both noobs & gurus write great code and is worth a deep look!
The below video reviews a few tips & tricks for working with functions.