There are many ways of doing this without using AppleScript. Several shell utilities make trivial work of this kind of thing.
This one-line awk script will show you one way:
awk -F / '/^D/ {print "D"$2"/"substr($1,2,2)"/"$3;}; /^[^D]/ {print $0;}' input.qif > output.qif
To explain this:
awk -F /
This invokes the awk command, using the -F switch to define the field delimiter. By specifying the forward slash we can break the date into its components.
/^D/ {print "D"$2"/"substr($1,2,2)"/"$3;};
This says that for all lines that begin with D (/^D/) print out a D followed by the second field (as denoted by the / field delimiter), then a / followed by 'substr ($1,2,2)' which takes the first field (e.g. 'D20') and strips off the first character), then another /, then the third field. This is the line that reformats the data.
Then:
/^[^D]/ {print $0;}
Takes every line that doesn't begin with a D and prints the entire line.
The two filenames, 'input.qif' and 'output.qif' denote the source file and the new file that will be created with the reformatted data. Adjust these file names as appropriate.