aBlock := [:times :delay | times timesRepeat: [
door open.
(Delay milliseconds:delay) wait.
door close ]].
aBlock value: 3 value: 30.
aBlock value: 3 value: 30.
You'd probably prototype this in a Workspace, then create the method suggested above, which would force you to specify keys for the arguments, thus forcing you to make your code cleaner and more readable.