Don't use $.sleep(). The documents are being queued to be closed, but they don't actually close until the script finishes running (due to weirdness in newer versions of InDesign). In your case, the sciprt never finishes because you have a sync script which sleeps between iterations. Use IDLE events instead of sleep, and the documents will be closed between invocations.
... View more