340 idles at 1500 won't stay running in gear

You have trash in your idle circuit. Pull carb and hold upside down and open throttle blade and blow threw them with compressed air.
Been there and had it happen. It won't idle because circuit is clogged.