Collapse or Open a Block Programmatically

So there’s a macro to hide a block entirely but is there a way to toggle it in the onLoad event (it will remain on screen but switched between opened or closed)?

The “collapse” setting in Form Settings > Layout > Blocks is just static.