Sorry, but that is way too big of an age gap to FORCE them to play together all the time. Even when they are close together in age, they should be allowed to play with their friends without including sibs in EVERY thing they do. (My kids are 13 and 10, and are different genders, and usually include each other on their own--but not always. The rule is that they don't HAVE to include them, but they DO have to be kind and not rude or un-necessarily exclusionary. If son and his friend want to swim, sister can swim too. The pool is plenty big enough for 3. If they want to hang in his room and play video games, if they can all play together, fine, but if they want time without her, that is okay too. Just no rudeness allowed. We also have rules for the sib that doesn't have a friend over. No being nosy and insisting on being involved in everything. It is their SIB's guest. If they do something that they don't really want you involved in, find something else to do).
But with almost 8 years between them? The reality of that situation (whether you choose to see it this way or not) is that essentially, your older daughter and her friend are being forced to "babysit" your younger daughter. For free. On their sleepover/play dates. That's pretty sucky, in my opinion.
Your older daughter should be allowed to hang out with her 10 yr old friends without the little one constantly under foot and in the way. And yes, I said that. That doesn't mean that your older daughter NEVER needs to interact with her sister. But it shouldn't be forced when she has a friend over. Did you read where I mentioned this is like making her and her friend babysit for free?
You need to arrange things so that the younger sibling is occupied so that the older daughter can do age appropriate activities with her friends (even if that is just sitting on her bed and talking and being silly) without her younger sister involved in it. They aren't conjoined twins. They are siblings with a 7, almost 8 year age difference.
ETA: Sorry to sound so harsh. I got a little caught up in my own mind, and confused part of one of the responses with your actual post. I see that you are looking for suggestions on how to fix the issues, not defending that they should play together. Sorry! Too much to go back and edit the whole response (on only one cup of coffee) but the general ideas still work: rules for both kids, not just the older one. Involve the younger in something else. Your older shouldn't have to close the door and lock it to keep the younger one at bay---she (younger sib) should be occupied with something else so that closing/locking door isn't necessary to keep her out of the older one's room.