Programmable inputs: A terrible idea... right?

I'm pretty sure this is a terrible idea with zero practical applications. But it's nagging at my brain and I need to get it out.

A "Do Not Disturb" toggle switch with Scratch blocks inside.

The idea is pretty simple: Create applications where inputs (like text inputs, number inputs, date pickers, toggle switches, and so on) can also be filled with code. In this example I'm showing Scratch-like blocks, but any style of code will do.

I don't think this idea has much practical utility. I keep racking my brain for a reason you would ever actually want this, and I'm mostly coming up empty. But for whatever reason it really tickles my brain in a way that is hard to shake off. Maybe there's something here? I just don't know.