If both files are referenced, then you should be able to just have a script in File A that runs a script in File B. The File B script would import records from a referenced File A, then close itself.
File A Script:
Perform Script [ From File B ; Import Records From File A ]
File B Script (Import Records From File A)
Go To Layout [ File A Records ]
Perform Find [ Records to Import ]
Go To Layout [ File B Destination ]
Import Records [ map File A table to File B destination ]
Close File [ File B ]
Note that you can have multiple tables within one file. There is no need for these to be separate files.
Understood that they are separate tables; and perhaps you truly do need to perform an import.