Consider the input:
=sec1= some-line some-other-line foo bar=baz =sec2= c=baz
If I wish to process only =sec1= I can for example comment
you could also use awk
awk '/sec1/{f=1;print;next}f && !/sec2/{ $0="#"$0}/sec2/{f=0}1' file