I haven't yet explore the source code of WBRun
There are several to chose between, but most common is the one that shipped with OS3.9 - any particular reason you may have the source code for that one?
It was left out of OS 3.1.4 because according to ThoR nobody needs it, and according to Gulliver (and various OS 3.1.4 FAQs that I suppose mostly he wrote), WBRun was replaced by a 3.1.4 spin (same, but different) of ThoR's own WBLoad (not to be confused with LoadWB) from his CLICon project, which doesn't even rely on Workbench to be running to work. Sad story is that WBLoad, unlike WBRun, isn't capable of talking directly with Workbench when it is running, so unlike WBRun, it cannot be used to for example open volumes, drawers etc. So after some... heh... heated debate between everybody's super hero (ThoR) and me, it was concluded that WBRun better be a script that checks if Workbench is up and running, and if so, tells Workbench to do its thing via arexx, and if Workbench is not available, simply use WBLoad. (Don't you remember? You typically pressed "like" on just about anything he posted)
Currently, this rudimentary script looks like this...
; $VER: WBRun 45.9 (24.10.2019) Kolbjørn Barmen <amiga[member=751]kolla[/member].no>
.key PROG/A,ARGS/M,DELAY/N/K,SHOW/K,VIEWBY/K
.bra [
.ket ]
If NOT "[DELAY]" EQ ""
Wait [DELAY]
EndIf
Status com=Workbench >NIL:
If WARN
WBLoad [PROG] [ARGS]
Else
RX "ADDRESS Workbench WINDOW '[PROG]' OPEN"
If NOT "[SHOW]" EQ ""
RX "ADDRESS Workbench MENU WINDOW '[PROG]' WINDOW.SHOW.[SHOW]"
EndIf
If NOT "[VIEWBY]" EQ ""
RX "ADDRESS Workbench MENU WINDOW '[PROG]' WINDOW.VIEWBY.[VIEWBY]"
EndIF
EndIf