I once purchased an e86 Z4 coupe, it needed a new engine in it.... but never was the same, was always something wrong with it.
Luckily I was able to get my money back as it was from a dealer.
After that experience I would avoid cars which have had to have a new engine fitted, if I had purchased privately I would have lost 11K.
To be honest, I dont think 12,500 is that good considering the history and the spec of this one, 11,000 would be better but I still would not risk it.
Someone was selling a 20i Msport for 13K on here a few days ago with similar mileage. May be best to wait.
If you go and have a look at it, test drive extensivley, longer than you might normally and turn it off and on a few times.
May also be worth mentioning that new engines need breaking in slowly, so might be good to see how the current owner drives it, if it redlines it or acclelrates sharply then the new engine may not have had the best treatment.
Lastly, you could ask the owner for the story on why it was replaced and then call the dealer seperatley and see if the stories match up!
It would be easier to walk away!
Good luck!