Golf Me A Text-Editor
Bash, 388 375 characters

Note that I am aware that further clarifications may come which will invalidate my solution.
Feel free to carry out any necessary modification in the requirement.
I posted this because the challenge is complex and may help to see how someone else understood it when editing for clarification.

set -f
IFS=
read -pfilename?\&gt; f
[ $f = DELETE ]&amp;&amp;{
read -pdelete?\&gt; f
[ -f $f ]&amp;&amp;&gt;$f||echo FILE NOT FOUND
exit
}
[ -f $f ]&amp;&amp;mapfile t&lt;$f
echo "${t[*]}--"
while read -plineno?\&gt; l;do
[ $l = q ]&amp;&amp;break
[ $l = a ]&amp;&amp;t+=('
')||{ ((l&gt;=${#t[@]}))&amp;&amp;echo Error!&amp;&amp;continue
read -pcontent?\&gt; c
[ $c ]&amp;&amp;t[l]="$c
"||t=(${t[@]::l} ${t[@]:l+1})
}
echo "${t[*]}--"
done
echo -n "${t[*]}"&gt;$f


Thanks to:


GammaFunction for suggesting set -f to make some quoting unnecessary (13 characters).