First, you have to create a list of IDs you don't want to delete:
SELECT id
FROM ##temp_final A
WHERE reply = 'BACK' AND
NOT EXISTS (SELECT 'X' FROM ##temp_final B
WHERE reply = 'DONE' AND A.id = B.id)
Then you put this in your DELETE query:
DELETE FROM ##temp_final
WHERE id IN (SELECT id
FROM ##temp_final A
WHERE reply = 'BACK' AND
NOT EXISTS (SELECT 'X' FROM ##temp_final B
WHERE reply = 'DONE' AND A.id = B.id));