I've added an apmd script to the wiki (under 'Resume on Close'). It's a hack, like all the other uses of devmem2, but it works for me.
This works in the sense that the keys don't wake the phone up anymore, this is good. However, once suspended with this script in place, the phone is not woken up by calls, and even if resumed, doesn't accept calls anymore.
EDIT: My bad, it seems the fault is not with the script. Rather I've rebuilt the kernel according to the instructions above to include dm support. It works, I can mount cryptsetup LUKS volumes, which is great, however it has the above suspend htcunid problem, as opposed to the original kernel.
But how can this be, I didn't mess with anything aside the dm and crypt support.
Specifically didn't touch the Power Management Options, left them set as they were, i.e. Power Management support on, Legacy Power Management API and Power Management Debug Support off, and Dynamic Power Management Debug Support and Driver model files on, and Advanced Power Management Emulation on.
Any ideas?
EDIT: Haven't figured out the reason for the error, however I've rebuilt the crypt parts as modules, and can use them now with the original kernel, which doesn't get stuck on htcunid when suspended. So this'll do for the time being.