Is there a way to edit a vertical block in a code without using the visual block mode selection?
What's so bad about blockwise visual mode?! There's no practical alternative to it.
:substitute with atoms like \%>v, \%, \%>l and \% to limit the pattern match to a rectangular block, but that's very tedious.  getline() / setline() and String manipulation in Vimscript.