We stay away from using global variables in a shared objectspace like SketchUp Ruby.
I will assumed the Box is made of grouped primitives:
grp = Sketchup.active_model.entities.grep(Sketchup;;Group).find {|g| g.name="Box" }
if grp
@pos = grp.transformation.origin
end