I have the same happen to me. MP3 players are probably responsible for a lot of accidents. But on most shared use paths, I find a quick ding ding on the bell is all thats needed.
Whenever I'm a ped on the railway path, I find a cursory glance over my shoulder lets me know that a group of cyclists are approaching from 200 yards etc. I'm not suggesting that peds should do this continually, but should be done when entering the path or if you intend to cross over from left to right and vice versa. I suspect many collisions happen due to sudden changes in direction ie. people suddenly step sideways. I have had near-misses like this, even when riding slowly and giving a few dings on the bell, some people inexplicably still almost step into you.
I guess some people just have a poor sense of spatial awareness.
But if, by stepping sideways without looking, the pedestrian and the cyclist collide, then I would submit that the cyclist was passing too close and/or going to fast. Not saying that you are guilty of that, as you said almost step into you.
Without wanting to go over well trod ground, pedestrians on a path, even shared use, should not be required or expected to check their surroundings for passing cyclists. Regardless of a bit of paint and a blue sign, it's still a path, upon which cyclists are tolerated guests.