Please wrap all code in "code" tags (see Text format box below the comment-field)…
Anyway, seems like all you need is a task that is either complete by a person before a certain time OR after the date expires, have the process move on to the next task, skipping the first task.
This can be done by using a timer-boundary event on the first user task, with "cancelActivity = true" as an attribute. The outgoing flow of the timer-boundary event leads to task2, exactly the same as the sequence-flow starting from task1 (effectively having 2 arriving sequence-flows in task2).
On top of that, when inspecting the process-history (historicActivityInstances), you'll be able to see whether or not the task was completed normally or if the timer was executed.