Your intuition proves to be correct, but you would need to give something a bit more formal in the solution to an exam problem. Your proposed constraint isn't strong enough since there is nothing in the inequality that forbids any one (or even two) of the edge measurements to exceed 8 meters.
The given constraint requires that the solution(s) for the maximum cost lie inside the cube $ \ [ 0 \ , \ 8 ] \ \times \ [ 0 \ , \ 8 ] \ \times\ [ 0 \ , \ 8 ] \ $ . This constraint is essential since the one for the volume of the metal box, $ \ xyz \ = \ 8 \ $ , alone would also any one or two of the edge measurements to "run to infinity". The "hyperbolic" surface is open, so the cost function, which is a linear combination of pairs of length variables, could be made arbitrarily large.
the open surface xyz = 8 with the location of the minimal cost indicated
$ \ \ $
With the "maximum lengths" constraints, the volume constraint surface intersects the planes $ \ x \ = \ 8 \ \ , \ \ y \ = \ 8 \ \ , \ \ z \ = \ 8 \ $ at three hyperbolic curves $ \ yz \ = \ 1 \ \ , \ \ xz \ = \ 1 \ \ , \ \ xy \ = \ 1 \ $ , respectively. This now requires the variables to lie in the intervals $ \ \frac{1}{8} \ \le \ x \ \le \ 8 \ $ and similarly for $ \ y \ $ and $ \ z \ $ in order to work on all three curves simultaneously.
the constraint planes added, with the intersection hyperbolas visible and the location of the maximal cost indicated
$ \ \ $
The Lagrange-multiplier method will only locate the one point where the cost function $ \ C \ = \ 8 \ xy \ + \ 4 \ xz \ + \ 2 \ yz \ $ can be tangent to $ \ xyz \ = \ 8 \ $ , which occurs for $ \ C \ = \ 48 \ $ , as you found. There are no other places where the "cost surface" will be tangent to the open volume constraint surface for any value of $ \ C \ $ .
Instead, we are left to check the curves on the three individual planes. We find on the plane $ \ z \ = \ 8 \ $ , for instance, that the cost function becomes $ \ C \ = \ 8 \ xy \ + \ 4 \ x \ \cdot \ 8 \ + \ 2 \ y \ \cdot \ 8 \ $ . Together with the hyperbolic equation $ \ xy \ = \ 1 \ $ , we have $ \ C \ = \ 8 \ \cdot 1 \ + \ 32 \ x \ + \ 16 \ \frac{1}{x} \ $ ; but this reduced function has a positive second derivative at its "critical point", so this is not a maximum value for the cost function. We obtain similar results on the other two planes, $ \ y \ = \ 8 \ $ and $ \ z \ = \ 8 \ $ .
This leaves us to check the three hyperbolic curves at each of their two endpoints:
z = 8 :
$$ \ C \ = \ 8 \ (1) \ + \ 32 \ \cdot \ \frac{1}{8} \ + \ 16 \ \cdot \ 8 \ \ \ , \ \ \ C \ = \ 8 \ (1) \ + \ 32 \ \cdot \ 8 \ + \ 16 \ \cdot \ \frac{1}{8} \ \ ;$$
y = 8 :
$$ \ C \ = \ 8 \ \cdot \ \frac{1}{8} \ \cdot \ 8 \ \ + \ 4 \ ( 1 ) \ + \ 2 \ \cdot \ 8 \ \cdot \ 8 \ \ \ , \ \ \ C \ = \ 8 \ \cdot \ 8 \ \cdot \ 8 \ + \ 4 \ (1) \ + \ 2 \ \cdot \ 8 \ \cdot \ \frac{1}{8}\ \ ;$$
x = 8 :
$$ \ C \ = \ 8 \ \cdot \ 8 \ \cdot \ \frac{1}{8} \ + \ 4 \ \cdot \ 8 \ \cdot \ 8 \ + \ 2 \ (1) \ \ \ , \ \ \ C \ = \ 8 \ \cdot \ 8 \ \cdot \ 8 \ + \ 4 \ \cdot \ 8 \ \cdot \ \frac{1}{8} \ + \ 2 \ (1) \ \ . $$
It is clear from this that in order to maximize the cost, we want the "product of two lengths equal to 1" factors to be multiplied by the lowest coefficients, $ \ 4 \ $ and $ \ 2 \ $ . Consequently, we need to have the product $ \ xy \ = \ 8 \ \cdot \ 8 \ $ , that is, as we recognized intuitively, the gold faces of the box should be squares with side $ \ 8 \ $ meters. This is either the fourth or the sixth of the equations above, giving a maximal cost of $ \ 518 \ $ dollars. (In fact, there are only three distinct cost values at the six indicated endpoints. In the diagram above, we see that this occurs because pairs of "cost hyperbolas" meets at just three locations.)
For length $l$ cm, width $w$ cm and height $h$ cm, the material costs $c$ in dollars are
$c= 20lw+ 6(2lh+2wh)+ 8lw$ $=28lw + 12h(l+w)$
Note that the set volume of the box means that $h=504/lw$, so
$c=28lw + 6048(l+w)/lw$ $=28lw+6048/l + 6048/w$.
Then the partial derivatives on $l$ and $w$ are
$\frac{\delta c}{\delta l} = 28w-6048/l^2 $ and
$\frac{\delta c}{\delta w} = 28l-6048/w^2 $
Solving for zero derivative we get
$l^2w = 216$ and $w^2l= 216 $
and thus $l=w$ at the minimum and we can solve for the dimensions.
Initial answer
It's relatively obvious that the top and bottom should be square, since we're looking to get minimum perimeter for the area.
So given that $s$ is the side length for the square base, the height $h(s)=504/s^2$ and the cost $c(s) = 20s^2+ 6\cdot 4sh(s)+ 8s^2$ $= 28s^2 + 12096/s$.
Then $\frac{dc}{ds} = 56s-12096/s^2$ and we can solve for the minimum at $\frac{dc}{ds} =0$.
Best Answer
Let $a$ and $b$ denote the horizontal sides of the rectangular box and $c$ its height. One seeks to solve the following problem: \begin{align*} \min_{(a,b,c)\in\mathbb R_+^3}&\left\{8(2ab)+1(2ac+2bc)\right\}\\\text{s.t.}\quad&\,abc=8. \end{align*} Substitute for $c$ using the constraint $c=8/(ab)$ and plug it into the minimand to get, after some rearrangement: $$16 ab+\frac{16}{b}+\frac{16}{a}.$$ I leave it to you to check that this function is minimized at $a=b=1$ (note that it is now an unconstrained minimization problem). Hence, the optimal solution is $$(a^{\star},b^{\star},c^{\star})=(1,1,8).$$