That seems like it's going to be a real PITA to solve, not just finding a box (or reverse engineering the pinout for a different box), but also if you had wires overheating and shorting out, you probably need to graft on more wire to replace damaged areas, and with the heat probably starting at the box contacts, may not be able to reuse them.
I suppose if the replacement box has the wire pigtail to some extent that could speed things up a bit but frankly I wouldn't even begin to pay a shop to do the work for a 19 y/o Ranger unless they can guarantee a fairly low total cost. I mean of all the things I've seen shops do well, soldering is not one of them! I suppose a dealer shop might just insist on replacing all relevant wiring harnesses ($$$$).
That part #, F87Z14A068AA, I don't know all the rules for Ford #'s but suspect the F87Z portion might vary, and the AA might vary too, with 14A068 (or at least part of that string) being the most significant digits.
You might also look for newer model year boxes since it has the newer style square cartridge fuses. Is that box even the original, unmolested box or has it been carved up already? I see a diagram for a similar box layout but in the areas yours differs, the relays are a little crooked and the box space looks funny. Perhaps it's just the heat damage. I'm looking at the following "3.0L and 4.0L engines (2001)" pic:
2001-2003 Ford Ranger Fuse Box Diagram » Fuse Diagram
View attachment 172373
Note that you could make that box work with minimal changes. The two major differences I see are in the bottom row of relays on the above pic, the group of four on the left is swapped with the group of 3 on the right, compared to yours.
Maybe you can even snap out those relay blocks to exchange the left one for the right one, BUT leaving it as-is and putting the box at the state shown in the diagram isn't necessarily a bad thing because then it is a known entity that is easier to service in the future. If it does not match the owners manual diagram then I'd print out the replacement diagram and put it in the manual.
Many of the Ranger boxes I saw pictures of, were missing some features apparently, so the box wasn't fully populated with sockets. Here is one similar to the diagram above with all the sockets present:
2000 00 2001 01 2002 02 2003 03 FORD RANGER Fuse Relay Box Engine Under Hood OEM | eBay
There are probably more of these on ebay or elsewhere if you want to go that route... that ebay listing is just an example.