I am not a lawyer; I have no legal training, and cannot provide any legal advice. Here, I aim to only provide contextual information, questions to consider, and design issues that may relate to the law. You are responsible for appropriately using this material. Please seek legal counsel before opening your room. The last thing you want is to go to court because somebody got injured playing your game. Go talk to a lawyer.
Some people build a space then get closed down - then do it all over again. For these places they have chosen a risky route of breaking local bylaws, getting shutdown, then doing it all over again. It works for them, but not something I can recommend. This law avoiding approach is at the very least reckless.
Players rightfully expect to be safe while they play your game and it is your responsibility that you keep them safe. This means that you should consider emergencies and everyday wear and tear on objects. You want your players to be able to escape in the case of fire and to not injure themselves in the room because you failed to check how secured a shelf is.
The easiest way to avoid lawsuits and trouble is to make the room as a safe as reasonably possible.
Local laws and emergencies
In some places you might be breaking the law just by locking people in a room. To be clear: you don't need to actually lock in your players to make a fun game. If in doubt about locked areas, call a lawyer and ask for legal advice for your region. You may unknowingly be breaking laws at different jurisdictional levels.
There are some issues you want to keep an eye out on to avoid legal problems when building your space. I know of rooms that have entirely failed to the most rudimentary research and have ended up breaking the local fire code (forcing them to close). It is always worth talking to professional tradespeople since something as obvious as a fire code may have unexpected nuances that you would not consider on your own. Depending on where you are and what zoning your building has you may be required to only have non-flammable furniture. Don't think that an observing game master can unlock all the doors before they pass out from smoke.
Even the heating, ventilation, and air conditioning (HVAC) system needs to be up to par; yes, I have heard of rooms being shutdown because they redirected an air vent. When working with a contractor you will want to inform them of what you are building so they can help you avoid future expensive fixes to meet regulations.
Before you open your game be sure you abide by your local laws and be conscious that you'll have to tell players where emergency escapes are.
Things to think about during the design process
When you are play testing your game you may want people to sign a Non-Disclosure Agreement (NDA) which can also be known as a confidentiality agreement. An NDA is a legal contract that will forbid the play testers to talk about the game until the game can be played by the general public.
NDAs will prevent people form just taking your game and cloning it before you open. If you have a custom system setup that runs behind the scenes which you show your play testers then an NDA might be something to consider. Basically, NDAs are useful for stopping people from openly talking about your game (and business) before you open.
If you are using a video game NDA template check to make sure it doesn't include a "free copy" of the game. Escape games are new to players and they are new to lawyers so make sure you have a NDA that works for what you are doing.
Personally, I am not a fan of NDAs because once you open your escape room all the "secrets" you are trying to protect are exposed to all players. An NDA will only give a few weeks of protection, and if your room is that easy to clone then you might not have a strong business strategy.
Other legal elements to think about
There are an assortment of other legal concerns that may come up. Some of these relate to one-off events and others may bear no relevance to your games, but they are worth checking to make sure you are not overlooking anything. When in doubt, seek legal consul.
Waivers
Waivers are more of a psychology thing than a legal thing. In many jurisdictions they are legally useless since you are still culpable for what happens at your place of business. What waivers are good for is making players realize that they are playing a real game in physical space (and that you can now mail them an invoice for anything they break).
There are template waivers you can find online by performing a simple search, although you should try to get waivers specific to your company. A template (or boiler plate) waiver could be a good starting point to edit from then take to your lawyer for any terms and clarifications that need to be added. If you do use an online service make sure that they cover your jurisdiction.
A waiver should be very clear to the players that they are accountable for their own safety. If you have do not touch signs or similar then the waiver should mention that the person signing the document knows what they look like and will not touch those objects. If there is anything unique to your room you will want that covered too. A waiver can make the difference in a lawsuit (even if they do not have teeth) since it is a demonstration that the player knew that there foreseeable risks when playing the game.
Security
In this context security is about keeping the players safe, not the objects in the room. This is relevant more to large group games and one-off events. The venue you are running the game at may require a security team to be present which may cost more. If you have liquor be served at your game security is something you will definitely want to think about including.
Insurance
This is tough because escape room owners classify themselves as different types of business and this impacts which type of insurance one needs. Research to find out what is the best way to classify your business as. In some cities you might be classified as a theatre and in other cities you might have to be classified as an amusement park. Insurance is usually connected to what your business is zoned as.
Zoning
Again, consider what the business classifies as. You might think that the abandoned warehouse district is a great spot for your games, but your local zoning body may disagree. The physical address of your business may up your costs based on insurance alone. Be sure to research if you can actually operate your business where you'd like to before you start building it.
Liquor
Local liquor laws might impact how you think about your business. In Toronto there is at least one escape room company that operates a cafe in addition to the escape rooms from the same address. If they want to start selling liquor they would have to take in consideration the rules around bars in Ontario (which are rather stringent). There are plenty of reason why people want to drink during an escape room but there may also be plenty of legal reasons why you cannot let them.
All of this is a long way of saying: go talk to a lawyer before opening your business.