As Trinity said, the Plugin API would be one way to go. The other would be to just try and include lib-common.php and go from there.
As has been posted here a couple of times already, to wrap something in Geeklog's framework you'll only need about 5 lines of PHP code like this:
Text Formatted Code
require_once ('lib-common.php');
echo COM_siteHeader ('menu');
echo COM_startBlock ('Some block title here'); // optional
// whatever you want to wrap goes here
echo COM_endBlock (); // optional
echo COM_siteFooter ();
Of course, if you try to wrap a complex script like that, you're risking variable name conflicts. But it's worth a try if you're after a quick'n'dirty solution ...
bye, Dirk