I have a 98, so it should be the same tail lamp install as yours. It's been a while so hopefully I'm not remembering wrong, but I had the bed off my truck years ago to replace the fuel tank sending unit. I seem to recall an electrical connector on the wiring harness that ran along the left side frame rail. It was towards the rear and disconnecting it allowed the bed to be removed without disturbing any other part of the wiring harness. If that connector is there(and there may be one on each side) it would be a place to look for possible issues. I believe your tail lamps are grounded through the harness. A decent wiring diagram should show that, though I've seen diagrams that were such a mess it was hard to tell if the intent was to illustrate or obfuscate.
The turn signal issue is interesting. The bulbs in the tail light assemblies are standard two filament types where one filament is your tail light and the other is both brake light and turn signal. My guess is when you have the turn signal on by itself all of the available current is going through the turn signal circuit and the flasher is receiving enough to properly function. When you step on the brake pedal a fair amount of the available current is now being diverted to the high mounted brake light and the opposite side turn signal/brake light bulb. The resulting voltage drop across these additional bulbs isn't leaving enough for the flasher to function.
Obviously this isn't right. You also mention that turning on the headlights leaves the tail lamps very dim. The filaments in the headlight bulbs are quite a bit larger than those in the tail lamps and will draw considerably more current when selected on. Normally there's enough current available to keep all the bulbs in the shared circuit happy, but in your case the headlamps are hogging too much of what's available for themselves. So what's limiting the available current?
It could be a week battery, but there'd likely be other signs of that and you'd have figured it out. Another possibility could be either corroded wiring or a poor ground. If you have an ohm meter, try checking resistance through the circuit at various points to see if it comes up high somewhere. Under normal conditions it should be darn near zero. Since you posted this on Monday and it's now Friday I figure there's a good chance you've already handled this. If so, I'd be interested in knowing what you found.