I'm an advocate of worship being something for the home/church and school being for learning. That includes learning about others beliefs - I think that could form part of Social studies in high school, (History/Georgraphy and Modern Studies) rather than having a topic of it's own.
Then there would be no need to opt children out (my back up position wopuld be an opt-in scheme instead)
I guess the situation in Scotland is a bit different. There may or may not be a handful of schools at most that receive funding as a specific religously targetted school. personally I am not aware of any. So, private education aside, you basically go to your local catchment school which is council funded and whilst the religion that has to be included is broadly Christian, tehre is no funding from specif religous organisations and there is no choosing pupils based on religion.
Then we have Catholic schools.
personally I think the whole notion of these schools (again entirely funded by the council) is outdated and breeds Sectarianism. You can apply to a catholic school as a catholic and will get a space. You can apply as a non-catholic and take your chances but to be fair, going to one as an athiest, you would have a hard time objecting to the religious element though you can withdraw just the same as you would for any other school. Interestingly, Catholic schools tend to attract religious people of all faiths more than non-demoninational schools do.
However, every child will have access to a local non-denominational school and additionally most will also have the option of a Catholic school. I say most as if you are in a rural area, there may not be access to a specific Catholic school just from a numbers point of view, so there is more choice in cities - particularly across the central belt.
You can also apply to any school you want with no guarantee of a space and it being your own responsibility to transport your child there but you are entitled to a space at your local school.