So we need to refine the proc like so (again untested):

proc AddZoomStack {g} {
  set cmd {}
  foreach margin { xaxis yaxis x2axis y2axis } {
    foreach axis [$g $margin use] {
      set min [$g axis cget $axis -min]
      set max [$g axis cget $axis -max]
      set c [list $g axis configure $axis -min $min -max $max]
      append cmd "$c\n"
    }
  }
  if {[info exists ::blt::zoomInfo]} {
    set ::blt::zoomInfo($g,stack) [linsert $::blt::zoomInfo($g,stack) 0 $cmd]
  } elseif {[info global zoomInfo] eq "zoomInfo"} {
    set ::zoomInfo($g,stack) [linsert $::zoomInfo($g,stack) 0 $cmd]
  }
}