how to stop a barn door from twisting a 2x8 header
If I understand correctly, your single thickness 2x8 header is sitting on a 4x4 post at each end (addressing each door's header as a single entity, not the entire 18' double-door span).

This means that you've got a 1.5" thick piece of wood (the nominal dimension of a 2x8) resting on a 3.5" thick post. 

Normal residential header construction requires that the 2x material be doubled with a 0.5" piece of plywood or OSB sandwiched in between. This will give you a 3.5" thick header (1.5" + 1.5" + 0.5") to sit on your 3.5" wide post. This gives you better bearing on the post and, more importantly, significantly more strength in the header. 

You don't indicate if the barn is build with residential-style 16" OC stud walls (unlikely) or is post-and-beam construction (much more likely). If it's post-an-beam, you probably don't need the load-bearing capacity of the doubled header, but, obviously you need it for torsional strength. 


Purchase a single 4x8 sheet of 1/2" plywood or OSB
Purchase 2 @ 2x8 x 10'
Rip 3 strips out of the plywood/OSB, each 8' long by 7.5" wide (the nominal width of your 2x8)
Put one full length strip of sheathing against the existing header board, tight to one end of the header
Cut the 3rd strip into the appropriate lengths to cover the rest of the header (approximately 12" - measure to get the exact dimension)


Cut each to the precise length necessary to match each of the existing headers

Push each new 2x8 into the pocket above the door it was measured for
Nail thoroughly 


2 rows of 3" 16d nails, spaced 6-8" horizontally should be more than adequate