Depends on who does the replacing. If you DIY, it's just the cost of the pump which he can find online. But even then, if the pump is say $40, and you're not sure it's the real problem, not sure it's worth it on a ten year old DW. If you get one for $250, it's like paying $25 a year for the use of it over ten years.
Whatever that black stuff is, it could just be that it's some really nasty stuff, just small enough, just sticky enough, that it's going to be there until it all works itself out. Unless something is deteriorating inside the works and that's the source. If it's so bad that it's not worth running to clean dishes, I'd just run it over and over, do 6 or 10 times and see if it's getting better or worse. I'd also try some extra heat cycles, if it has that option. The commerical cleaners for DWs use citric acid, which you can buy at Walmart in the fruit canning supplies, for a lot less. But I don't think that will do anything with this black stuff.