If you are only a little averse to the popcap settings then you just need to make sure that a liason successfully visits your fortress and then leaves alive after the popcap has been exceeded. The migrants should stop fairly quickly. If you really want the pop cap to not be exceeded then I believe DFHack has a command that force updates your civilization's track of your population, which will stop all future migrant waves (assuming no dwarves die) if you run it after the wave that passes your pop cap.
For your brewing there is a fairly easy way to greatly reduce the amount of canceled brewing tasks. Simply open up the stock(p)ile menu and then look for the "reserved barrels" setting. Increase the number of reserved barrels up to 5-10. This reserves a certain number of barrels from basic storage to only be used in workshop tasks, (such as brewing) and usually ensures that as long as you have at least one empty barrel you will be able to brew.
An easy way to cancel out pretty much all bad thoughts is to set up a simple
mist generator in a common area of your fortress (say above the dining room entrance). Being pleased by mist is a fairly powerful thought, and if a dwarf is being comforted by it every time they walk into the dining room they will quickly rack up enough positive thoughts to outweigh almost any bad thought. In fact mist is such a powerful good thought bringer, that it was pretty much the only mechanism that could be used to cancel out the bad thoughts from being naked on babies before Toady removed them.