Welcome to the forum.. the good news, you'll have a very nice truck with a warranty. You can't really beat that..
I'm still hesitant to recommend a EcoDiesel out of warranty or really well over 100K, just a ticking time bomb unfortunately.
It's likely the truck will not regen with that code.. I'd recommend getting it taken care of asap. As far as replacing it, if you can identify the proper one I feel like a person can do it to save some money for sure. But emissions sensors/codes are touchy sometimes.
If you have dirt in your fuel, I'd try the insurance route first. A) Vandalism or B) Bad fuel... let the insurance find out which one. Also, let the dealer show you the said "dirt".