Setting: a large sea that can only be accessed through a waterway. The waterway is about 15 by 15 kilometers but blocked off by a giant wall stretching from nearly one side to the other that is about 50 meters wide and twelve meters high. The lake contains several islands that together are the base of an empire. Lands surrounding the sea are infested by zombie-like creatures making them uninhabitable.
The purpose of the wall is to (obviously) block incoming ships. The hostile ships are mainly (European) enlightenment era ships but instead of cannons make use of ballistas (and on rare occasion trebuchet like weapons). Their enemies also have airships, but are hesitant to use them seeing they are rather vulnerable (hydrogen based) and are unable to carry siege weapons and are therefore dependent on simple archers.
But due to their rather unfortunate surroundings they require the wall to have a gate so ships can pass through for trade, and they also have colonies outside of the sea so it requires openable gates for ships to pass through.
Their technological level varies between early 1800's and early 1900's (early stages of electricity, but still mainly reliant on sailing ships, no power tools). And they had over 300 years to build the wall while having to deal with few hostilities (the enemies they did have were not able to reach the construction site).
The islands contain the majority of the empires population and ruling government. Resource wise it is a huge investment but doable. Most of the world is unexplored, from what they did explore there are two rivaling powers. One nearby in which they are in a cold war with and one far away (months of travel).
The wall also has several ships protecting it.
So here is the question, would such a construct be feasible? And what would they have to consider while building it/making it as good as possible for the purpose of blocking a potential invasion fleet.