Nice! Always love to see some personally engineered redstone contraptions!
If I may offer suggestions:
You can increase the depth of the pit and line it with trapdoors so they’ll still pathfind in.
You can use pressure plates for autonomous activation as suggested by other commenters
If you have or can find some slime making the pistons sticky-pistons and having them move solid blocks should make the mechanism more dangerous to the mobs.
Nice! Always love to see some personally engineered redstone contraptions!
If I may offer suggestions: