Pages.add with local camera settings

Sketchup.send_action is not synchronous. The successive Ruby statements can be executed before the view is done changing.

To speed things up, temporarily switch off scene transitions.

Secondly I don’t think I’d do it the way you’ve done it (ie, using the send_action.)
Before the iteration, I would setup a camera looking straight down and set it to the view:

center = model.bounds.center
cam = Sketchup::Camera.new(
  center.offset([0,0,model.bounds.depth]), center, Y_AXIS, false
)
view.camera= cam

During the iteration I would zoom(object) instead of entering in the object’s edit context.