The part about the problem not occurring when the iPod is stationary is interesting. iPods that use a hard drive for storage "cache" song data (into its operating memory) at intervals. I think it caches about 20 minutes of the upcoming music each time, but the amount (of music time) depends on the "bit rate" used to encode the songs (for MP3 or AAC). Higher bit rate (less compressed and higher quality) song files take up more space per minute, so less music time can be cached. Songs that use a "lossless" format are the highest quality but take up MUCH more space; not very much can be cached by the iPod.
The caching is done to (1) save battery power and (2) allow continuous playback. (2) may be relevant here. For iPods that use a hard drive for storage, when the iPod is being jostled about during use, the hard drive (because it has sensitive moving parts) cannot always access its data. But because upcoming song data is cached (and the iPod is playing from its cached data), the playback is normally continuous.
So, if the caching is not working properly, or if the hard drive is becoming less reliable, the iPod may be running out of cached song data because it cannot access the hard drive to cache the next portion of song data. That's when it stops playing. When the iPod is stationary, the hard drive is accessible when needed, so this problem does not occur.
If you recently did something to your iTunes library, such as replace all of your lower bit rate 128 kbps song files with 256 kbps (or higher) versions, that may also contribute to this issue, because the iPod is now caching fewer minutes of music each time.
"Normal" movement of iPod is fine (normally), so it may help if you can carry the iPod in a way that minimizes exposure to repetitive strong movements (or vibration) that continue for extended periods.
NOTE: iPods that use flash-based storage (such as the nano) do not need to cache song data. Flash storage has no moving parts. They are better suited for wearing during exercise.