a dirty drivetrain won't really result in the symptoms you describe. When a drivetrain is older and very dirty it tends to stick to the front chainring causing "chain suck". This is when the chain sticks to the chainring and gets jammed, usually on the chain stay. This will jam up your cranks and if pushed too hard will break/bend your chain.
Unfortunately I don't have a write up at the moment on how to adjust your cable tension. There is a simple way to test it.
* small adjustments can be made at the barrel on your shifter
- If your rear derailleur is slow to shift to a harder gear then you have too much cable tension.
- If your rear derailleur is slow to shift to an easier gear then you don't have enough cable tension.
- Make sure that your derailleur is able to get into every single gear.
- If your rear derailleur doesn't shift well up or down then you likely need new cables/housing (gunked up, too much friction)
- If your bike shifts fine for half of your gear cluster but goes out of tune for the other half, then you need to align your hanger
Also you can stand behind your bike and spin the cassette via the cranks. Look at each cog and make sure none of them are bent.
Sometimes when I get stumped on a bike I very slowly turn the cranks and watch how the chain interacts with all of the gears. Watch everything that rotates and look for smooth movement.
There is also the possibility that your drivetrain actually is worn out. The first thing to go is usually your middle ring, the chain with slip off under high torque. Perhaps you have more miles on it then you think (though usually one has less miles than one thinks
I replace my chain 2-3 times per season (about every 1000 miles). I replace my entire drivetrain every season (about 3000miles). I replace my cables/housing 2-3 times per season.
Never replace your rear cassette without replacing your front chainrings.