Here is an outline for a 'spel' approach, using a single event. If you need more detail on how to attach events to a task and so on, I'm sure one of us can help.
When the approval task goes pending, use a 'behavior' to attach a non-repeating event to the task with a 24 hour delay. The macro launched by the event will do the following. (The value 'N' referred to below can be configured in the 'Text' field on the event and will then be accessible as 'user_smag' from the running event).
If (task status == Pending) then
Read the field 'zReferral_count' from the task; //'zReferral' will be a new integer field in the
// object 'wf', defaulting to 0
If (zReferral_count < 'N') then
Look up the current assignee's manager;
Reassign the task to the current assignee's manager and send a notification;
Increment 'zReferral_count' and save the updated task;
Attach a new instance of the same event to the task with a 24 hour delay;
Else (zReferral_count >= 'N') so
Set the task status to 'Failed to be approved';
Endif
Endif
Let me know if you'd like more details.
Regards,
James