GPRS connection problem

Your sketch works fine in my shield. Your problem may be caused by the condition that you introduced in gsmAccess.begin.

Change your gsmAccess.begin line to the following:

if((!PIN_OK) && gsmAccess.begin(PINNUMBER)==GSM_READY){