I can't see anything obviously wrong in the logic of the code.
I would run the sketch sending its serial down the wire to the pc and monitor what is actually being sent without involving the vdip.
This will help you work out if it is a bug in the code logic, or a mismatch in communication between the arduino and vdip.
If the code runs sending incremental file creation messages above what you get when connected then i would try connecting the vdip, and commenting out the value writing bit to see if i could create multiple files without writing data into them.
The writing with cts and rts connected to each other on the vdip is not how ftdi tell you to work, so it is proving unreliable - it could be that this is causing your problems.
I hope to look into it soon but don't have the time right now - there are other messages on the forum about this issue, and someone is grappling with it and may come up with working code sooner.
HTH
Nick