I think he was an angel -- definitely. And at the end, the girl could see him for some reason, and she knew he was reshaping time. He wasn't supposed to fix the doll, but he did anyway -- out of pure kindness.
He's dropped unceremoniously from the sky.... His tools of the craft follow the same.... He alters the deterministic machinery of a situation...?
It's basically a device for touring the mind of God, pardon such language on an atheist site.
First you're introduced to the determinism ( the butterfly effect ), that you can skew primary events, but that they have to play out ( i.e. no teleporting the gangsters to Tibet, etc. ) and then the play is run back and forth and back and forth.
I thought that the broken doll at the end should have been left broken. In the world where great calamities are avoided, invariably a few tiny things might fall apart and we, as humans, must learn to accept a bit of loss as the side effect of meddling supernatural agents making the world in a macro sense, better.