there is already the command /lwc mode persist Then type the /cmodify command.
This allows the next command you type to be activated for every chest, door, trapdoor, furnace ect. you hit. The down side with it is you have to re-log to disable it.
Note- Im not 100% that its the correct command as I've not used it in a while.