I'd start by reading out any error codes stored in the ECM. Might provide a clue, and it's easy to do.
Next, I suppose you could try the "learning" procedure, especially if the problem came up after you disconnected the battery for some reason. To "teach" the ECM, drive around at moderate, varying speeds for awhile, until it smartens up.
If the above doesn't work, try unplugging the IAC. If the problem goes away, you know that the engine's speed has been changing because the ECM has been telling it to...