ECU replace or reprogram? on 2007 Chevrolet Impala

2007 impala 3.5 non flex fuel,secondary air injection pump replaced,pump runs with command on thru shop scanner,but computer/ecu not activating pump,told its a ecu problem,is it likely that the ecu needs a reflash,or more likely needs to be replaced,reflash at dealer $100,cost of ecu $300 plus install and reflash,lastly will a used ecu work if reflashed?

Asked by for the 2007 Chevrolet Impala