This is only a try and I doubt it will help but, I have an 06 2500 that was factory wired for towing. The blue connector (4 pin, red white, blue, black) is located up along the firewall almost to the left side of the truck.
I'm a little surprised that your trying to wire for trailer brakes on a truck with the 4.7 engine. I have a utility trailer with brakes (16 ft 2 axle), but I wouldn't tow anything heavier than that with not a real heavy load behind a 4.7. I originally started with an 07 Toyota Tundra with a 4.7, bought a toy hauler to carry a couple of quads. It pulled the trailer fine but gas mileage was dismal. A trip to Moab UT convinced me that this was definitely not the right combination. On the way back to AZ we ran into a strong head wind, the truck was turning around 4K rpm for the first 60 miles and used 3/4 of a tank of gas. On the trip home with that setup we averaged 4mpg. Two weeks later I had my 06 2500 with a Cummins in it.
I was able to wire the Toyota for trailer brakes, but I'm sorry I just don't remember how I accomplished it. It did not have a trailer brake connector so I think I bought a kit for the truck and used that to do it. I have three trailer/towing bookmarks I probably got the kit from one of them. They are HitchSource, HopkinsTowingSolutions and ETrailer. Just add a .com to the end of their names if your interested.
Mike