I fiddled with stuff for a while and I think I have it working on my board. It wouldnt work for me at first either and I got the same errors. It's cuz the variables were changed me thinks.
$points were turned into $bbuserinfo['storep']
I copied and pasted the bits of code and the templates I used into the text file. So far it works fine, only thing I havent tested yet is picking the lottery winner (since I had one running while updating the store)
I hope it's ok I post this. Do not own this hack etc - just trying to help.