You can uniformly cook the cube if $f$ is harmonic, i.e. $\Delta f=0$. Note that, if e.g. $\Delta f>0$ everywhere, then the center of the cube will always receive less heat than the average over a sphere with the same center. Thus if $\Delta f$ happens to have constant sign, it must be zero.
To achieve uniform cooking in the harmonic case, let the center of the cube stay at the origin and rotate the cube using a Peano-like curve $\gamma:[0,1]\to SO(n)$ such that the push-forward measure $\gamma_*m$ (where $m$ is the Lebesgue measure on $[0,1]$) is the normalized Haar measure on $SO(n)$. Then the heat received by a point $x\in I^n$ is the average of $f$ over the sphere of radius $r=|x|$ centered at the origin. Since $f$ is harmonic, this average value equals $f(0)$.
To construct such a curve $\gamma$, follow the standard procedure for the Peano curve: partition $SO(n)$ into reasonable sets (connected and with piecewise smooth boundaries) and visit all of them by a continuous path; this path is the first approximation. Then subdivide the partition and change the path so that it visits all sub-parts but do not make new intersections with boundaries of old parts. And so on. At each step, choose the parametrization so that the time spent in each piece equals its Haar volume. Let the diameters go to zero, then the paths will converge to a Peano-like curve $\gamma$. The push-forward measure $\gamma_*m$ coincides with the Haar measure on all elements of the partitions and hence on all Borel sets.
Remark. A similar trick works if $f$ has compact support (more precisely, its support should be separated away from the microwave walls by distance at least $diam(I^n)$1). Just move around and rotate so as to realize a Haar measure on the relevant subset of the full isometrytranslation group of $\mathbb R^n$ rather than $SO(n)$.