This is my first try at a patch, so I hope everything's okay.
This patch adds 3D cursor rotation support to 'snap 3d cursor to selection'. In edit mode, it snaps to the average normal direction, in object mode it snaps to the average object rotation.