you can literally just have the coffin brick have a minigame event set where it's onMinigameReset -> opencw
This isn't reliable by the way.
When you have a minigame on by default it does not reset the minigame so when the bricks load they do not open.
Causing you to have to reset manually which can be tedious.