Hi,
I have implemented bitcoin handling in many sites. I can fix the error, however for security analysis it require time to review and fix, security fix is not a plug-n-play thing, apart from your script itself there are many things that need to look for possible security holes.
Please let me know if you are interested and I am ready to go.
Thanks & Regards
Sandeep Verma