Running IPhone apps while in sleep mode
[UIApplication sharedApplication].idleTimerDisabled=YES should do it
I found a great webpage that explains how to do it -
Cached link from Wayback machine
Original Link, now 404
You have to start a timer that plays a sound every 10 seconds. But the sound can be silent.