Basically, when Smith takes over a person, part of that person is still residual in there. Once Smith had realised that he'd seen the end and he positioned himself he said something (I can't remember what) then looked confused.
The Smith that Neo was fighting used to be the Oracle, and she was the one who said those words, not Smith. Neo knew this and realised that he would still have some presence even after Smith had take over his body.
Neo allowed Smith to take over his body and once that was done the Source (for lack of a better word) was able to kill off Smith (like a virus) through the direct link it had with Neo.
That's why you see the Oracle at the end of the scene.
Hope that clears it up a little. I had a doc file that explained it a bit better than that, but I can't find it. As soon as I do, I'll post it :-)