Sorry for speaking to myself. I have figured it out. I have done the following. Thanks again for your help @elliot
<script type="text/javascript">
jQuery(document).on('acf/setup_fields',function(e){
//alert('test');
jQuery( "#dialog" ).dialog();
});
</script>