Thats an interesting concept much better than what I'd thought of. I was thinking of just a plain square one. If your using SS code its probably possible to make the trench unmelee-able using segments of flyer code. If the trench is then surrounded by barbed wire you could then justify not being able to use melee on the trench. Hell, you could make the trenches garrisonable so that the more squads you put in the trench the more stubbers are active and the more units are up on the firing step much like the IG listening posts.. I know its possible because its done in the AS mod if you've seen their listening posts.
If you want confirmation of the possibilites with the code the best person I can recommend is mankyle if hes prepared to help.