This secret doctrine was to abolish religion and establish reason in its place when at last Reason becomes the religion of man so will the problem be solved

What is the correctly punctuated version of this sentence?
This secret doctrine was to abolish religion and establish reason in its place: "when at last Reason becomes the religion of man so will the problem be solved."