A compactness result for a second-order variational discrete model