I want the open/close to be manually toggled and to persist across buffer open/closes. This implies it needs to add/remove comments, which I'm okay with.
Good question! I love IntelliJ, however I find it's documentation abundant but mostly useless for learning stuff. This behavior is mentioned in passing here Write and edit source code | IntelliJĀ IDEA (TIL, there's "surround with" action for this), but I personally have learned about this when reading source code of IntelliJ itself...
lol. This was my exact experience trying to write a custom plugin -- got no where with the documentation, did a git clone of the community edition src, and started grepping through it to understand the types.