Do not use this PR php code each you need to display results to a user! Fire it as a batch program for PR you don't have or are out of date, and store the results into a table. The PR you should show to your users should be the results of the consultations from the table.
You know - I'd be interested in knowing EXACTLY what Google "BANS" you for. I'd hate to think I'm spending all this time trying to "build" my website then do some crazy tactic and have the rug pulled from under my feet.
Do you want just to check PR or in details? ///Edited: Saw your time of post. Obviously OP have found what he wants.
I don't think they ban you, they just put a grey out the page that is calling the PR checking php script. They may ban you if you have too many requests, but there are still sites out there that offer a PR-button and have a PR of 5 or more.
They also ban the IP if too many queries are made. I created a Bulk pagerank checker script few days ago and It got banned due to high number of queries. To fix this I inserted and sleep() and it was working again after a 24 hour ban
They will recover it after a while 2-3 weeks. meanwhile, ur site doesn't appear on the search. I had a friend fell into this case.
You can use instead some plugins for example the firefox SEO plugin. Or go to some site that is offering free pagerank checker it's much easier they allow you to embed their codes to your site.