A:
Unfortunately the documentation for the script engine is still rather minimal at this point, which is why I originally was saying that this feature wasn't possible atm as the "shape" connector was missing from the documentation. It is not uncommon for names in the UI being different than names used internally.
Regarding adjusting the configuration, if you only need to set it once this can be done by changing the DSPStream.addBlocks call to
await DSPStream.addBlocks({shape: {type: "PulsedSpectrumShape", config: { histdev: 16, histmindens: 0.1, freqspan: 20e6, persistence: 0.7 }});
That will set the specified values whenever the script block is restarted. The provided values are the defaults (e.g. 20 MHz span), you can adjust those as needed within the blocks limitations.