Okay, I found out why, and it revolves around me being a lazy tw@;
I don't normally " save " scripts — instead I choose to use " Run and Advance " as it generally runs scripts fine, allowing you to test them out before you save it. It seems that, although I was saving the function first, using " Run and Advance " on a function doesn't work (at least a function in the form above). You actually need to use the more general, and obvious, " Run ".
I feel like an idiot but I'm glad I found it out instead of giving up on it.