It seems it's not possible to map the long press for work/life button. But there's a way to make it launch custom action while You are at Today Screen.
1) Download Mortscript
2) rename the mortscript's dummy.exe to modeswitcher.exe
3) copy it to windows folder with resco explorer, total commander or similar, replacing the old one
4) make a mortscript modeswitcher.mscr and make it do whatever you want, copy it to windows folder
Et voilà - now the long press for WL button runs Your script.
For some reason this only works while You are on Today Screen. Maybe it depends on ROM You are using, some ROMs support the WL button remapping anyway.