Yes, this is doable.
Create a boolean variable called “modal_open” with a default value of false.
Set “modal_open” too true when you want the have the modal open.
Bind the Display of the modal to the value of “modal_open”
Create a workflow on the modal for “on mouse leave”. Change the value of “modal_open” in the next action too false.