Code:
on *:sockclose:mysock: { 
  .timer 1 1 echo -a $!iif($input(Test,yidb,Asking),$!,$!)
}
As Riamus said, you need to use a timer like as shown below. If the yes button is pressed, it'll return $true, else it returns $false