So I checked things out myself, and the cables and housings didn't look that dirty. I was tempted to lube the cable inside the housing just to make sure, but I didn't want to gum it up even more. So I took it to the mechanic (he checked my bike before and he was willing to look at it for free). He tested the shifters and adjusted the cables a bit, but he said he didn't know what was wrong with it in the first place. I asked him if the cables needed tightening or loosening or if the housing needed to be cleaned, and he said it all looked fine. Just to try it again and if I still have the same problem, he'll try something else.
I'm going on a ride tonight, so we'll see.