The automatical power off is a APM or ACPI feature. The IBM R40e doesn't support APM but the newer ACPI. Sadly ACPI hangs the notebook while trying to switch to C2 and C3 cpu throtteling modes (slows down CPU frequency for lower power consumption).
For enabling ACPI on your R40e you have to apply this patch and recompile your kernel:
http://bugzilla.kernel.org/show_bug.cgi?id=3549
This will disable C2 and C3 processor states, but the rest will work fine.