Код:

AssignFile(f1,SaveTextFileDialog1.FileName);
Reset(f1);
{$I+}
If IOResult <> 0 then
begin
Application.MessageBox('Не удается открыть файл "*.txt"','Ошибка открытия файла',mb_ok);
Application.Terminate;
end;
AssignFile(f2,SaveTextFileDialog1.FileName);
Открываешь файл (и блокируешь), а потом в него же пытаешься записывать