While the living group is entering in the guest mansion, Dalinar enters through the basement window and leaves it unlocked. Astrid locks Arya and Adolin in the basement. Astrid and Shallan head to the first floor. Shallan then leaves the first floor, she doesn’t have to open any entrance, she used an entrance that was either unlocked or had been left open. Shallan finds Dalinar and kills him, she wasn’t on the first floor when this happened. Astrid also left the first floor like Shallan, and headed to the basement, she opens the basement window, which was unlocked by Dalinar. Inside the basement, Astrid locks the window, kills Arya and Adolin, and breaks down the window to leave the basement.
Regarding All entrances into the basement were locked at the time the door was locked. Which door? When?