I don't think writing your own front-end extension
https://4js.com/online_documentation/fjs-gdc-manual-html/#c_gdc_FEextensions.html would necessarily be any better as that relies on the 4gl initiating the call, you want the scales to initiate the call.
I'd experiment combining your two methods. Have the Delphi program populate the clipboard with the weight, and then have it send an obscure keyboard combination e.g. Ctrl-Shift-W, or an unused functionkey (the main thing is it is not something you would type into a field)
Your 4gl program then just needs an action that has this obscure keyboard combination or unused function key defined as an accelerator, and the on action then reads the clipboard, and passes the value in the clipboard into the weight field.
Focus won't have to be in the input field, it will just have to be in a dialog that has this action. You would have to watch out for keyboard buffering.
Reuben