It sucks that shop failed you. I spoke with the guy who inspects my truck and he says with the 07s they have to check the vin to see if its a lbz. If its an lbz no emissions. So none of that should have ever came up.
Now that the state has to inspect it, its hard to say what they will be looking for.
You get a cool guy who knows that truck doesn't get plugged in and maybe youll be fine.
Or get a guy whos having a bad day and they hit you for egr, cat, muffler, lift, tires sticking out, and lose steering or rear axle seal leakage, and any rust.
I wouldn't sell the truck. Craigslist could get you everything you would need to pass and you wont lose your shirt. I would fix what you can easily on the truck and have them inspect it and have them make a list of what it needs. get that guys info on what days he works. fix that and go back while hes there. And nect yr go to a shop who knows a lbz doesn't get scanned.
Good luck.