Are you looking for a piece of code or for someone to write a routine for you ??
If you're looking for a piece of code, there are several posts here at the swamp regarding accessing entities in blocks and modifying entities in blocks. By searching these, that'll get you the code for getting into the blocks.
Then it's a simple process of identifying the hatch and deleting it, then moving on to the next block.
If you're looking for someone to write the code for you, good luck. The guru's here are more than willing to help you learn to write the code, offering what they can when you are stuck, and throwing out a boatload of suggestions. But to just write code for a fellow swamper they won't necessarily do, believe me I've tried.