Thank you for your post.
Without seeing your file, it is difficult to determine where the problem lies.
I would add a "Halt Script" script step after the "Go To Related Record", just to make sure you are going to the right layout. This should not give you a second dialog box. You can then look for another "Show Custom Dialog" after the End If command.
Thankyou, so simple really.
I put a 'halt script' where you suggested and there was nothing after that. I moved it to after the 'end if' and now the dialog box only appears once, it must have re-run the script when the new layout opened. Thankyou for your assistance.