In case the script (or the underlying framework implementation) is repeatedly opening and closing the file handle during its work, it may encounter a sharing violation error in the subsequent write-mode open for the following reasons:
1) The script may request the write access in exclusive mode (excluding concurrent read access), so if your file editor/viewer program is even only reading the file yet, it may trigger a fault in the writing script.
2) Additionally, some file editors/viewers lock the file for the entire duration they have the file open.
In conclusion, there are possible problems that depend on the program you are using for viewing the file. And there are possible problems arising from the implementation (or the underlying framework) of the script that writes to the file.