WinDbg scripts are always a bit hacked. The following seems to work, although I haven't applied it to a breakpoint yet:
aS /c filename .printf "c:\\writemem\\write_%i", $t1; .block {.writemem ${filename} 00ba0000 L1}; ad filename
When you apply it to a breakpoint, you will probably have to avoid quotes again.
aS , /c . .printf. filename.
WinDbg , .. , filename . .block .
, ad .