See this thread where we tried to find a workaround.
Basically, a script or an automation “last triggered” survive a restart. Depending on some options several “input_XXX” objects have their status reminded.
So you could either use a dummy automation, triggered when the device goes into “not_home” status, and then use its last_triggered attribute to fire the automation after 7 days, along with the condition that the device is not at home (meaning its been home for 7 days).
Or you could use an input_number, set it to 7 when device goes not_home, then find a rule to decrease this value (every day at midnight for instance) depending on the precision you expect. Your automation starts when the number reaches 0.
Or you can try the input_datetime component that also supports the restore_state function, set it to now()+7 days when device goes not home, and then trigger the automation when this day/time is reached. Never tried this component though.