I'd take a look at the CSO KB Atricles #1417 and #8599. They list ways for you to paramterize gui checks, and although this isn't exactly what you are trying to do, it should point out what needs to be created and fed into your function to allow the checkpoints to be used.
Insanity: doing the same thing over and over again and expecting different results
GUI checkpoints can be included in user-defined functions, if the function are not in compiled modules. GUI checkpoints are not allowed in compiled modules.
If you create a user-defined function and do not store it in a compiled module, the function will be removed from memory when you stop a test run. You will need to execute the body of the function again to reload it back into memory before use.
User-defined functions are typically kept in a compiled module so that the function can be loaded into memory and available for use within tests even after the test run has stopped.
GUI checkpoints are not legal in the context of a compiled module, as stated in the WinRunner User's Guide:
"The content of a compiled module differs from that of an ordinary test: it cannot include checkpoints or any analog input such as mouse tracking. The purpose of a compiled module is not to perform a test, but to store functions you use most frequently so that they can be quickly and conveniently accessed from other tests."