you can create a property which will store the previouslyAssignedOperator to have the operatorID of the user in case assigned to a WL and WB name in case assigned to a workbasket. Along with for ease you can also have another property say previouslyAssigned to have the WorkList or WorkBasket values.
Use these 2 properties to assign your case back to respective WL/WB
Use OOTB Activity pxTransferAssignment to assign cases from activity
If you have to use the routing in the flow on assignment shape, go with custom routing -> use assignemnetType as cpmWorklistOrBasket, write your own activity with a logic to set param.AssignTo to the value of previouslyAssignedOperator you created.