Note that 'gray' is not the same as luminosity. You can extract the luminosity of an image by changing the images colorspace and separating the channels.
Actually just changing the images colorspace and restricting operations to just one channel will also work!
See IM Examples, Channels page
Actually the sub-page where they use the same edge mask to both despeckle/blur non edges and sharpen edges, may work a lot better in IM. Especially now that the three image masked composition works with grayscale (fixed IM v6.3.4-11)
http://imagemagick.org/Usage/compose/#maskRemember unsharp is in actual fact a extrapolated blend of a blured image with the original
http://imagemagick.org/Usage/compose/#blend_useIt may be that rather than a simple single value blend, we could make a extroplated blend that can both blur and unshapr an image on a pixel by pixel bases under the control of the pre-prepared edge mask.
It may turn out simpler than expected or not, and a proof of concept may be posible using -fx or pixel iterated PerlMagick, or just as described above using a masked composition. Publish your findings here!!!