I just realize that the script still works even no unique name is generated (Using a same document name). Is there any pitfall or anything that I should be aware of if i plan on using that?
Only that you might confuse script debuggers. Come to think of it, we've never tested debugging support without unique script names.