Just edit depatment and set after how many seconds user should be redirected to leave a message form.
As for bonus you can have the following fancy workflow
This workflow can be even futher enhanced by transfering chat to another department first and only then showing feedback form. In that case "Rejected" department have to be configured to redirect user to feedback form.