Brazil by the 1820s and even during the first attempts to industrialize, (D. Pedro II) was a highly dependent in agricultural exportation, therefore Portugal could try to re-establish itself has the main trader (protectionism/mercantilism) to the re-exportation business of colonial goods to Europe, using Lisbon has a trading HUB. Britain had rights to one Brazilian port in S. Catarina (for what I could gather, could have been more). This would definitely be advantageous to both kingdoms. The establishment of higher tariffs for British goods would limit their influence, those could then be re-exported to the newly established Latin republics, importing silver, to Brazil from the Argentinian/Bolivian nations, and trading colonial goods for the manufactured ones, appeasing Portugal's ally.
Portugal at this point needs to:
> Respect the Brazilian position has an equal kingdom (in the past at least 2 times, during the Reformation in 1640s and during the 18th century, there were proposals to make Brazil the center of the Portuguese Empire, a connection of Europe and Asia), D. João VI has to somehow make the Cortes accept this, what could be negotiable I do not know. Therefore Brazilian Cortes will not be abolished and a centralized control of all states but those comprizing the northwest, Piauí-Maranhão to Amazon, could be an exception, where a Condominium of Portugal and Brazil would be established since trade currents and winds from Portugal connect both regions easily, while Brazil the opposite is true.
>Keep Appeasement of the landowner class, low taxation and no tariffs of the importation of their goods to Portugal would be a away to grant them more profits, keeping them in the Portuguese side.
>Brazil should be supported militarily by the metrolope, in any projects to influence the region (like maintaining Uruguay, even if by compromise). Since OTL most of the officers were Portuguese, ITTL it would be easier to send reinforcements with Capitains to be subordinates of the Portuguese Generals in Brazil, preserving the officer cadres from Portugal, and at the same time making the cadres autonomous, one from the other.
> Reform the Portuguese economic system to make it less dependent in British goods, investment in industrialization should happen to create national demand for colonial goods, especially cotton that could be developed in joint efforts from both kingdoms in Maranhão (a Condominium would be helpful to articulate and develop faster this region).
> Introduction of new botanical species should be attempted by both kingdoms. An Empirial botanical garden must be created to study and adapt Asian species in Brazil, black pepper, cloves and others.
Other things I could be forgetting.