A fun Valentine's day chocolate box optimization problem...

My intuition says that this should be the diagram.

enter image description here

This means that the optimal band will not cross the top at a $45^{\circ}$ angle, unless the box has a square top. Otherwise, the line has a slope equal to $\frac {w+h}{l+h}$ and has total length.

The length marked off by the right triangle goes from the middle of the front tot the middle of the side. Its length is $\sqrt { (\frac {w+h}{2})^2 + (\frac {l+h}{2})^2}$ and is $\frac 14$ the total length of the band.

$2\sqrt {(l+h)^2 + (w+h)^2}$

On further thought... doesn't change the answer, but it does introduce a small nuance.

The band travels across the top twice and the bottom twice and each side once.

Figure 2.

enter image description here

The shortest distance is a straight line, and the dimensions the line must cross is $(2h + 2w) \times (2h + 2l)$

However, there is nothing that says the shortest distance is in fact symmetric in the way it crosses top and bottom.