This could be done with the aid of an extension. See, e.g., the Select By extension in which you can specify the starting and ending regex within the keybinding. Keybinding:
{
"key": "alt+q", // whatever you want
"command": "selectby.regex",
"args": {
"flags": "m",
"backward": "^\\w", // since your block starts flush left apparently
"forward": "\n^$", // stop at first empty line
"forwardInclude": false,
"backwardInclude": true
}
}
Here is one that I wrote: Jump and Select. Use this keybinding:
{
"key": "alt+q", // whatever keybinding you want
"command": "jump-and-select.jumpBackwardSelect",
"args": {
"text": "^\\w",
"putCursorBackward": "beforeCharacter",
"restrictSearch": "document"
}
}
This should select from the cursor back to the first blank line (given your well-structured code examples).

To select the block from anywhere, you also need a macro extension like multi-command and this keybinding:
{
"key": "alt+q",
"command": "extension.multiCommand.execute",
"args": {
// "interval": 200,
"sequence": [
{
"command": "jump-and-select.jumpBackward",
"args": {
"text": "^\\w",
"putCursorBackward": "beforeCharacter",
}
},
{
"command": "jump-and-select.jumpForwardSelect",
"args": {
"text": "^[^\\w]$\n?",
"putCursorBackward": "afterCharacter",
}
}
]
},
"when": "editorFocus"
},
