SaltStack states pattern and replace for multiple files under directory and for multiple line matches
You should use Jinja to loop over a list of files and pattern/replacement pairs.

{% set files = ['/a/foo.sh', '/b/bar.sh', '/b/baz.sh'] %}

{% for file in files %}
{% for p, r in [('/aaa/bbb', '/aaa/ccc'), ('/xxx/yyy', '/xxx/zzz')] %}
replace {{ p }} in {{ file }}:
   file.replace:
      - name: {{ file }}
      - pattern: {{ p }}
      - repl: {{ r }}
{% endfor %}
{% endfor %}


Keep in mind the identifiers need to be unique, that's why variables in replace {{ p }} in {{ file }}: are used.