Paying a shop, if it's the chain will the rattle sound be continuous or just when on the throttle?
It honestly depends on how worn components are in there. My buddy's 2005 with the 4.0 V6 started out just rattling at idle and disappearing above. It progressively got worse, getting louder and showing up more often. Eventually, the guide failed completely and the chain was riding on the bolt that had previously held the guide to the back of the engine (meaning it never quit making noise at that point).
Paying a shop you're looking at over $1000, possibly over $1500 depending on the quality of parts used and what they're charging for labor. As I said before, the engine has to be removed, there is a lot of labor there, and then you'll need all of the chains, guides, tensioners, a few gaskets, a few bolts (the bolts in the cams and balance shaft are single-use), coolant, oil, and oil filter, and that's if nothing else is wrong. You'll also need to make sure the shop you use has the right tools for the job, as there are two special service tools involved in the procedure. (I've done two of these, one in an Explorer, one in a Mustang).
It
could be something else entirely, I'm making a long-distance shot-in-the-dark best-guess based on incomplete data over the internet without seeing or hearing anything in person, but it
sounds like what I've dealt with in person on a few of these 4.0L engines.