Any emacs mode that does a similar thing to this?
A loong time ago I found a package on Usenet that emulated sam's command language. I found something on github[1] that seems to be a recent modification of that, but I haven't tested it myself (last time I loaded sam.el was in Emacs 19.34, back when I was actually using sam to do C programming).