Hello
You can create a new report program which will check the validity of the substitution for the given date and then reassign the workitem from one agent to another. Refer to below link for reference.
You can use FM
CALL FUNCTION 'SAP_WAPI_GET_WI_AGENTS'
EXPORTING
WORKITEMS = lt_wi_ids
WITH_SUBSTITUTES = 'X'
and forward workitem using FM SAP_WAPI_FORWARD_WORKITEM
Create a 'Workflow Agents' Report in 5 Simple Steps
Regards
Sandy