When I open your original file in the Sublime text 2 editor, it appears as follows:
For my configurations, a simple text string should be all colored red. The green characters are back slashed escape characters. Ruby uses forward slash (i.e. division symbol) for directory paths, not back slashes for all operating systems. Sketchup for Windows has its version of Ruby “tolerate” backslashes somewhat. The culprit may be the “\n”, which is a newline character.
I used backslashes to my download folder on your DXF, and I see the same error. I can make it work by changing the double quote to single quote. I can also make it work if changed the back slashes to forward slashes.
Your new changes though are now Mac compatible, and have no hard coded paths. (You are not handling the situation if the user selects the cancel button from the open dialog box though).
On Windows, Sketchup’s “openpanel” method does return paths with back slashes, but they are all “escaped” correctly.