Why are you using Insert File in your script. You would be much better to use Insert PDF or Insert Picture. Not that that necessarily explains the display issue, except that with either of the other options you will get an image of the first page of the PDF in the field, instead of the file symbol, you are getting now.
If the related field is in a portal you may want to refresh the portal before exiting the script. If not maybe try to refresh the window?
My guess is it has something to do with your relationship and not the repeating fields. Try narrowing down the issue by using a regular field from the same table and see if you get the same results. If so then you need to look at the relationship and/or the script that is adding the PDFs and consider why there is so much latency.
As a simple test, click a blank part of the layout background instead of "exit the table and then return to it."
If that works, then your script need only add a Commit Records step to automate that update.