I don't know if there is anyway to do this simply using the VISA write file VI. But there are a couple of ways you can do the same thing using other VIs. One, you could read the entire file at the beginning of your VI and store the commands in an array, one command at each index of the array. Then in your while loop, using the normal VISA write VI and not the VISA write file VI, and write out array[0] during loop index 0, array[1] at loop index 1, etc. Or Two, you could use a read file VI in conjunction with the VISA write. You could manipulate the file position using the file vi's, get the data you want, and then write it with the normal VISA write.
I hope this helps!