I had a customer who was developing a LOB application which included navigation ask me how they could stop the PIN lock being enforced if someone was using their application. They didn't want the lock to occur in their application as the user would be driving but they did want pin lock enforced outside of the application.
There's an API called SHIdleTimerReset that the program can call periodically to keep the device from locking.
You can call the API periodically to prevent the device entering a locked state...
Now before anyone hits me with a security question - This API is there for applications where you don't want the screen to lock not to bypass security.