Most ladies have been raised taught that having their hair tied up is actually a way to protect their braids as well as hair. So we tie our hair when it is out or when we want to keep our weave looking fresh - but when we're wearing braids we throw all of that good practice away. Covering your head with a satin headscarf at night not only keeps your edges looking fresh it also protects your roots from drying out while sleeping.
If you find satin headscarves uncomfortable then place a silky pillow case over your pillow for a similar way of protection. Ait would actually be much better if you do both. Wrap your head and invest in a satin pillowcase. If your headscarf comes off in the night you still have the protection of your satin pillowcase.