With RSMB you can connect a roto node to |FG matte| in RSMB, turn off then Main BG Amount to 0.0
For Nuke roto node you might need to connect it to the input as well so it has the right size (it defaults to project size). This will have the foreground blurred (spilling over the background where there is motion).
If you are talking about masking the output, you need to use a Merge operator with the original No Motion Blur and Motion Blur node as input
Pierre