As I recall those engines had an issue with ingesting material from disintegrating pre-cats after 100K km, installing pre-cat elimitator headers early prevented damage. 2.5K sounds like a lot of dough for a used engine of unknown condition, but there is a good chance demand is high due to the failure rate. I recommend trolling the mazda forums for info. A rebuild is likely the best option, but the damage could be extensive enough for the block to be damaged which will raise the costs if a replacement is needed. I believe the engine is shared with some ford products - I would look into that as well before making a decision.