Never mind. Got it working! If anybody else struggles with this, the issue was that the callback function can't have an argument, so the line:
should have read:
And instead of defining the function:
It should be:
Anyway, this is a great site; looking at the archives has been a fantastic resource for delving into AE scripting.