It sounds like the sequence of commands you're looking for is
/END DATA/,$d
q
.a
NEW END
.
wq
or as a one-liner
printf '%s\n' '/END DATA/,$d' 'q' '.a' 'NEW END' '.' 'wq'
(You can replace wq with ,p for testing.)
Ex. given
$ cat file
Data 1
Data 2
something_unimportant_here END DATA
Rubbish 1
Rubbish 2
then
$ printf '%s\n' '/END DATA/,$d' 'q' '.a' 'NEW END' '.' 'wq' | ed -s file
gives
$ cat file
Data 1
Data 2
NEW END