So apparently it is possible to keep the processor going processing stuff while the screen is locked, as indicated here:
http://stackoverflow.com/questions/1551712/running-iphone-apps-while-in-sleep-mode
However, after testing with the example code, UIAccelerometer will just stop giving value as soon as the device is locked pronto. Is there a way to force otherwise?