Simon:
What would the legislation look like? How would it be worded to only apply to religious shunning?
There is no reason why such legislation would need to apply only to "religious shunning". It would apply to organizations that direct people to shun others.
Would it be of any value if people were still shunned? What would the penalties be?
Similar to other anti-discrimination laws.
Would it mean people who should be shunned couldn't be? (e.g. child molesters)
People should be given specific warnings about individuals who may pose a threat to society (or to vulnerable groups in society) and individuals can then make their own informed decisions about who they associate with, but that doesn't mean that certain people 'should' categorically be 'shunned'.
There's a big difference between "keep children away from A because he's a convicted child molester" and "don't talk to A because we said so".