Your plan to fix the gap in the center of the door sounds fine. I might suggest using some shingle shims instead of flat stock however. If you want to just remove the interior trim only, that is fine also. Using the shingle shims, place the thickest end in first and by trial and error, adjust the opposing shim to a size that will snug in nicely and then by gently tapping it in next to the first shim, remove the excess gap. Put a small finish nail through the jamb and shims to prevent them from moving. Drilling a pilot hole will assure not splitting the shims with the nail in inserted. Now just trim off the excess and reinstall your trim. Job done! Good Luck
The brace is providing lateral support. If you build a wall with the top and bottom plate plus some studs, it's easy to shift the wall out of square and turn it into a parallelogram. Under load, a house would take an 8' shift to one side and flatten to the ground. With the brace, the wall remains square and holds perpendicular walls plumb.
In typical construction and low risk areas, the exterior wood sheathing and interior drywall provides this lateral support and avoids the need for any lateral bracing. However, in older homes or in higher risk areas, particularly where there are hurricanes or earthquakes, extra support may be added. In my own home, this was done with a metal T that was installed into a grove that was cut in the studs, but older homes will more likely notch the studs and install a piece of lumber.
Before removing this, I'd want to consult with a structural engineer. They may require that you relocate the brace to one or both sides of the doorway, and that will require opening up your walls even more. Removing this structure will likely show little signs of danger until there is extreme weather or a seismic event, so if you were to remove it without proper adjustments to the rest of your structure, don't assume that everything will be ok.
Note that with a truss resting directly on top of this wall, you should assume there is some load passing through, especially if there's any structure above that truss in your house. The fact that it's been cut for ducting may mean that the wall is the only thing keeping that truss from collapsing. When you create a doorway, it's best to install some temporary bracing and make the header a load bearing structure that appropriate for the span.
Best Answer
For small gaps between wooden trim such as doorframes and plastered walls I use a "Flexible gap filler" - available at any DIY store. Spending a few minutes reading the containers carefully and asking store assistants will get you a product you can try.
Description from a randomly selected product
Another one
It is often a good idea to rake out the corner first, to remove loose or weak paint. Then sand as necessary before cleaning and filling.