general case adding when_run block
Merge pull request #305 from code-dot-org/calcWhenRun

general case adding when_run block