Have you read up on the Patterns functionality? The thing is, what you describe makes sense in a big interpreted language. But on Teletype, each script is run on demand - for instance, on every Metro tick - and so to scale a sequence by an amount, you’d just take the sequence in memory, pull an item off it, multiply it by your scalar, and chuck it out one of the CV outputs. You could adjust the scalar mid-sequence and it’d all be fine.
But rather than operating on a whole array, you just operate on the current item. Because each tick of the clock you can use (eg)
P.NEXT to get the item, your SCRIPT is, effectively, the code inside a
filter block. You’re already inside the iterator.
Teletype Studies 5, linked above, covers a lot of this. It is a much more imperative model of programming than you are describing.
(The “filter by named scale” example is a little bit more challenging, I believe, in the current TT syntax, simply because named scales aren’t easy to grab hold of.)