Nevemind, @Andreas_Hegenberg already showed mee how to do this
Leaving this message as a future reminder to myself—or to help anyone else who comes across the same problem.
The key to returning the value is this…
let result = await runShellScript(shellScriptWrapper);
await callBTT('set_string_variable', {variable_name: 'somevariablename', to: result});
As recommended by the online docs, wrapping the shell script in a self executing async function solves the problem for me of variables staying always being up to date.