When ever you disconnect the battery or replace the IAC motor it needs to be reset! The reason the idle is surging is because the ECM does not know where to position the IAC pintle. There are 2 ways to learn the IAC setting one is using the GM scan tool to perform the function, the other is to let it idle for a couple of minutes in drive and then in park. Sometimes this works but it is easier to use the scanner. Call a dealer and ask how much they charge to relearn the IAC. In my shop we charge 30 minutes of labor for this.