So like with most posts, it’s hard to give specific pointers without a replay, so if you can post one great. Otherwise I can try and give some advise based on your statements.
1.) Against Terran, there aren’t very many options for a pre BC attack to begin with, and BC’s don’t get out until 5:30 or so at the earliest, when the lair is already done or at least morphing. Terrans also don’t have many good options outside of harass or cheese, so both parties would rather go into midgame anyway. I would recommend a more eco focused approach against Terran.
2.) Camping on 2 base comes with it’s own risks on the Terrans side. They give up map control, eco, and delay any transitions as a result. Let them turtle all they want while threatening with mutas or swarm hosts while upgrading, teching, and mining at your own discretion. Keep tabs on his army size, and have enough army produced to take a positional fight when he moves out - sooner or later he will try.
3)Thors are surprisingly susceptible to roach/ravager armies, especially if there are some ling/bane filtering through the roaches and drawing fire away from the bulk of the army. I think it takes 2 hits from a thor to kill a roach, also 2 hits to kill 2 lings (same larva cost), and lings keep tank splash off the roaches. They also catch most of the cyclone lock ons, even if they get roasted by hellions right away.
Roach/ravager has good burst damage, so the hp and armor of thors is less meaningful against them. Infestors are more for if the game goes the distance and you need to remove 5-6 thors from a fight. They can capture the thors once the fight starts, launching neural too early gives them away.
4.)Mech comps are not as reactive as the Zerg race as a whole, all zerg needs is the right tech. Terrans generally need to decide their tech choice before Zerg since their tech tree is so much smaller, so we have the opportunity to see their tech before they can use it and respond accordingly. For them to react to us means we are showing our hand without using our advantages. It could also mean we are not scouting and therefore not knowing that we are making the wrong units until it’s too late, a sort of build order loss that’s still preventable, so it’s on us to keep an eye on them.
Things that help me against mech are generally scouting related. Seeing that it’s mech initially is critical, an overlord spying the factories or armories in production is ideal, as nearly all mech armies can be fought with just roach ravager ling bane. Catching them out on the map is best, because they will set up a siege line in a very tricky location once they get to you, but are slow and are easily flanked when on the move. This requires having ovies, changelings, or lings out on the map to see the move out, or even creep spread. Lastly, spellcasters are an amazing tool, and in most cases I would recommend vipers over infestors. Abduct forces trades, especially when you can use high ground to shield them from view, and blinding cloud negates the positional strength terrans like to use so much with mech. Separate control groups are a must for them, and make a couple extra if you are still learning them so you can get a couple spells off before they all die. It’s expensive, but makes the world of difference.