I had to do something similar about a year ago and ended up doing the main bit in JavaScript using setTimeout. Clearing the timeout and then restarting it when there was mouse movement (and mousedown & mouseclick for touch screens), key presses, scroll.
Before you redirect them after the timeout period also remove the #mainContent node before doing the redirect, this will stop any dirty fields from raising "do you want to save your changes" type messages.
Also, remember that you may need to run a process (flow/workflow/plugin) on the Dataverse side of things, because you are using a multistep form you will have a record created once they move to the second step - and so depending on your scenario you may need to remove those records.