If there are people, wrong way cyclist, anything in the shoulder or BL that I am riding in I don't try and share the shoulder/BL. Instead I would stick my left arm out early, keep looking back and negotiate a gap into same direction traffic and pass that way. That would have avoided the confrontation, which of course doesn't mean that you were not in the right and does not mean the kid was an idiot for making sudden moves.
It does seem sketchy to try and share a 3' wide shoulder with a pedestrian by riding on line with a lot traffic passing on your left.
Al