Appendfile (under Maxima 5.40.0, SBCL 1.3.1.debian, Ubuntu) creates file, but puts nothing in.
Writefile (under Maxima 5.40.0, SBCL 1.3.1.debian, Ubuntu) puts output in, but not input (and neither newlines in between %iN and respective %oN labels).
Bug #772 still present under Maxima 5.37.2, GCL 2.6.12, Ubuntu.
Just've found that it works correctly at Maxima with clisp.
Maxima 5.40.0, SBCL 1.3.15, Windows 7 x64
Appendfile behaves itself like Martin Saturka have said already.
For Writefile look at attach.
ECL and CMUCL: nothing saved at appendfile, output-only at writefile;
CCL: saves all at both appendfile and writefile;
https://bugs.launchpad.net/sbcl/+bug/1721598
Just copying here what SBCL folks say: