Setting up restrictions in a grid based level editor

So basically I let the user create a level on a 256 block grid. On each grid they can place a block to build a level. Example:

However I want to make sure that players leave 1 space open as a door. What are ways to do this logically in C# or do I need some sort of pathfinding ?


Check this answer: