Try commenting out all the code between OpenFile and CloseFile to see if it's this which is causing the hang. If so, you could add the file to an area rather than using OpenFile, to see if that helps.
The above applies to the window when it is opened for the first time. If the window is already open and I choose Window/Restore Position, the window takes the correct position. Namely, the upper left ...