would probably be to have onTrigger activate a schedule loop that continuously checks to see if the player is still looking at the object
keep track of the start time using $Sim::Time and when $Sim::Time - start time >= 10 call the function and break out of the loop
if the player releases the button, cancel the schedule