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.
Is it possible to use the parameter --skip-register-on-import with multiple registers, either by using a comma-separated string or by specifying this parameter multiple times in parameters.txt?
Thi...