well, in renoise there is always a selection, so what I did (here is the mess in its current state (add silence works fine though)) is simply use that always: select nothing/all and the start/end/both option applies to the whole sample, otherwise to the selection. dunno about obvious, but once you know what it does I think it’s pretty much perfect.
can scripts even know where that is? I think there’s just selection or no selection, and a single click into the sample does not constitute one, there’s no way way for scripts to know abou it… could be wrong about this though.