custom scripts are just single lines of jass or equivelent in a GUI trigger, functions are groups of actions that take and return handles or values.
You use these when you need to do something GUI can't do, or when you're scripting in jass instead of using the GUI.