add this script to the popup window
<script src="/assets/print_window_close.js" type="text/javascript"></script>
contents of print_window_close.js
jQuery(document).ready(function() { setTimeout(function() { window.close(); }, 1); });
basically, seTimeout is called only when the document is focused, which happens only when the overlay dialog is closed. therefore, it works exactly the way you wanted.
source share