In Emacs, I can create functions in Lisp language and place them in .emacs file. Those function will become commands that can be called from the editor or bound
.emacs
A few marketplace extensions may be of interest:
However in general, you'll need to write an extension to do anything complex.
There's also a VS Code issue tracking support for built-in macros