Surface + Normal Snap Tool?

Is there a tool that in addition to the shift+ctrl functionality of the move transform tool also rotates the object to the target normal direction?

Can anyone give me some pointers how I could implement a custom tool like this?