Mine does this all the time when it's around 20% power.
It'll alert you, the bar goes red, then you give it a bit and it goes back to green.
I'm not entirely sure where I heard this, or if I'm just pulling it from my arse (which I likely am), but I'm pretty sure it's to do with heat.
When you hold onto the iPod for some time heat from your hands will warm up the battery slightly, which for whatever reason (I'm not an electrician) makes the iPod read it as having more power than it does.
That or it just not good at calculating the power it has.