in reply to Seeking guidance for more idiomatic way of (re)writing this script.

Quick observations: