Both things are easy to do. You can auto-index the array into a for loop, compare each value, and in one case statement, use the build array function on an array maintained by a shift register. In the other case statement, wire the shift register straight through. Look at the shipping example called Separte Array Values to if you're having a hard time understanding.
OpenG has a function called Filter 1D that will work too. You can also avoid adding the zeroes in the first place with a shift register. Assuming that a while or for loop surrounds your case statement, create a shift register and in the false case, simply wire the shift register straight through.