Hypervirial analysis of enclosed quantum mechanical systems. II. von Neumann boundary conditions and periodic potentials