#!/bin/bash
s='#ABC
oneSize=bar
twoSize=bar
threeSize=foo'
sed '/^#ABC/{n;s/Size=bar/Size=foo/;n;s/Size=bar/Size=foo/}' <<< "$s"