Scratch does allow you to make your own blocks with optional input. My math students use them to learn about abstraction. The most recent implementation was released last winter and is written in JavaScript.
Visual Lambda: Note how the gray block after the "report", shrink-wrapped around the "call (fn) with inputs (fn) []", is a visual "lambda". It looks like a "gasket" or "baggie" that insulates the code inside from being immediately evaluated, returning a closure instead.