I felt really bad that you waited 5 years for a response. I hope you can sleep now. I built a wooden door with legs to go on the stairs for my dog to lay on with his bed. He crashes next to me all the time and when driving I was afraid he would fall down the stairs. Did you give up your idea or did you build one?
I welded a few pieces of angle iron to the sides of the stairwell and cut a piece of 1" plywood that sets down onto them. If you retain the stock bi-fold door this also makes a great lock!