For a template content of:
[office]
type = select
label = Office
code=0
editCode=0
the block of code “Code #0” will be called. The $values and $valueLabel arrays are exposed at that time, so you can dynamically fill them. I ran a database query for my custom post type in my code block and set the values at that time. $values and $valueLabel are parallel arrays, and $valueLabel is not required if you want your items to have the same labels as their values.