My SIL used to have an '05 Impala with a bunch of miles on it. It started acting funny, running rough once in a while, and shifting weirdly. I tuned it up (needed plugs bad), serviced the trans (the fluid was awful), and basically caught it up on maintenance. While it ran much better it still wasn't "right". Some quick internet research pointed to a possible MAF sensor issue. I called my buddy, a former GM mechanic, and asked his advice.
He said to warm the car up and while it is idling smack the top of the MAF sensor with the handle end of a screwdriver. If it stumbles and almost dies or does die, replace the MAF sensor. It did so I replaced it and the car ran fantastic after that.