Improving performance of a subroutine that checks for a vacancy in a lattice
Three thoughts about this. 

First is unless the lattice is small you won't actually run into a boundary condition most times. Check if a boundary condition is possible once and have two CheckForVacancy functions one with and one without boundary checks.

Second thought is remove the boundary check altogether by adding duplicate elements.  In one dimension if you had the following

Index:1,2,3,4,5 
Value:3,4,3,2,1


Make the array

Index:0,1,2,3,4,5,6
Value:1,3,4,3,2,1,3


So you trade extra storage to remove the bounds checks.

Finally, you still have a lot of no_ops in the for loop. All those add zero statements do nothing.  You could unroll the loop to eliminate them at the expense of more code. You removed the 0,0,0 option already I think.

Your comment indicates that the lattice gets modified during execution, that makes removing the bounds check more complex. 

Depending on the size of the lattice and the number of times you call CheckForVacancy for an individual cell you could either memoize the cells adjacent to a cell or pre-compute them.  This would work if you have enough memory and if you call the function with the same values multiple times.