Answer
The work done on the dipole is positive.
Work Step by Step
We can write a general expression for the potential energy:
$U(\theta) = -\mu \cdot B$
In orientation 2, $U_2 = -\mu~B~cos~\theta \lt 0$
In orientation 1, $U_1 = \mu~B~cos~\theta \gt 0$
We can find an expression for the work done on the dipole:
$W = U_1-U_2$
$W = (\mu~B~cos~\theta)-(-\mu~B~cos~\theta)$
$W = 2\mu~B~cos~\theta \gt 0$
The work done on the dipole is positive.