As the public SDKs are not including the APIs for that, you would actually need to do your research by yourself. So, go to symbian foundation and search their sources, you should be able to find the unlocking part if you search for the locking part, i.e. search first for the EnableAutoLockEmulation.
It is not going to be easy task, the symbian foundation parts would only cover Symbian^3, and if you would want to cover oldere devices, you might need to do multiple technical support cases with API partnering. and I'm nearly sure that there is no solution for 3rd ed E-Series devices using tarm.
If you are willing to spend some quality time on that, then take my advice, I would though suggest just letting the user keep his/hers control on the device, I find it hard to understand why the user would needed to be locked away.