I remember reading somewhere that the dohra was originally recited by Guru Sahib at Sri Hazoor Sahib, and a few scribes like Bhai Nand Lal Ji wrote down the dohra. There were also other scribes present like Giani Giani Singh; interestingly there are some differences of the dohra written by these different scribes. Either way the dohra we know was memorized by majority of Singhs at Sri Hazoor Sahib, and has been passed through oral tradition and it is the same as the one written by Bhai Nand Lal Ji which is
ਰਾਜ ਕਰੇਗਾ ਖਾਲਸਾ ਆਕੀ ਰਹਿਹ ਨ ਕੋਇ || ਖ੍ਵਾਰ ਹੋਇ ਸਭ ਮਿਲੈਂਗੇ ਬਚਹਿ ਸ਼ਰਨ ਜੋ ਹੋਇ ||
Some variations include the following written by an anonymous Sikh sribe
ਰਾਜ ਕਰੇ ਖਾਲਸਾ ਸੋ ਆਕੀ ਨ ਰਹੈਂਗੇ ਕੋਊ, ਖ੍ਵਾਰ ਹੋਇ ਸਭ ਮਿਲੈਂ ਬਚੈ ਸ਼ਰਨ ਜੋ ਪਛਾਨੈ ਗੋ
Either way the meaning is the pure Khalsa will rule the panth . Meaning those that keep rehat shall mange the affairs of the panth. The kwhar will not mingle with panthic affiars. The khwar ( kurehiti) will be only be protected and be part of the panth ( roti beti di sanjh) when they pesh.
ਕੁੜੀਮਾਰ ਰਮਰਈ ਨੜੀਮਾਰ। ਜੋ ਇਨ ਮਿਲੈ ਸੁ ਹੁਇ ਹੈ
ਖ੍ਵਾਰ। ੧੩।
-Guru Panth Parkaash Bhai Rattan Singh Bhangu
Anyobdy who does roti beti di sanjh with those that are messed up ( khwaar/kureheti) will also be separate and not be able to participate in the management of Khalsa affiars.
So the kureheti ( ਖ੍ਵਾਰ) will only meet ( roti beti di sanjh) with Khalsa when they pesh and begin to live a distinct lifestyle once again.
Guru Sahib says
ਜਬ ਲਗ ਖਾਲਸਾ ਰਹੇ ਨਿਆਰਾ। ਤਬ ਲਗ ਤੇਜ ਦੀਉ ਮੈਂ ਸਾਰਾ। ਜਬ ਇਹ ਗਹੇ ਬਿਪਰਨ ਕੀ ਰੀਤ। ਮੈ ਨ ਕਰਉ ਇਨ ਕੀ ਪਰਤੀਤ।
Guru Sahib says he will give his governing power (ਤੇਜ) to those that keep the distinct (ਨਿਆਰਾ) lifestyle/rehat. But those that follow the Bahamans, Muslims etc will only be separated from Guru Sahibs blessings.
ਕੁੜੀਮਾਰ ਮਸੰਦ ਜੋ, ਮੀਣੇ ਕਾ ਪ੍ਰਸਾਦਿ
ਲਏ ਜੁ ਇਨ ਕੇ ਹਾਥ ਕਾ, ਜਨਮ ਗਵਾਵਹਿ ਬਾਦ ।੨੦।
Bhai Prahalad Singh Ji
ਨਾਨਕ ਤਿਸੈ ਬਸੰਤੁ ਹੈ ਜਿ ਸਤਿਗੁਰੁ ਸੇਵਿ ਸਮਾਇ ॥ਹਰਿ ਵੁਠਾ ਮਨੁ ਤਨੁ ਸਭੁ ਪਰਫੜੈ ਸਭੁ ਜਗੁ ਹਰੀਆਵਲੁ ਹੋਇ ॥੫੯॥
O Nanak, the season of spring comes to one who serves the True Guru.
The Lord rains His Mercy down upon him, and his mind and body totally blossom forth; the entire world becomes green and rejuvenated. ||59||