The keys to the basement were with Arya and Adolin, they can unlock the door tot he basement, also the door can simply be broken down.
The window was opened after they were inside the guest mansion. Isn’t that obvious?
Dalinar entered in the guest mansion while the living group was entering as well. Astrid locked Arya and Adolin in the basement. Shallan finds Dalinar and kills him. Astrid leaves the first floor. Astrid doesn’t have to open any entrance, she either broke it down or it had been open in the first place. In the basement, Astrid kills Arya and Adolin entering through the door, she unlocks the door, kills Arya and Adolin and, upon leaving, makes it so that the door cannot be used without locking it. When Astrid and Shallan arrived at the door, Astrid unlocked the door, and the trick was undone.
When the copypasting cry