Your code is pretty messy, and you have some redundancy in there. Anyways, the raycast will return the ID of the first item it hits matching the mask
This is what it should be
%eyePoint = %player.getEyePoint();
%id = containerRayCast(%eyePoint,vectorAdd(vectorScale(%player.getEyeVector,5),%eyePoint),$TypeMasks::FxBrickObjectType);
You don't need to normalize the vector because it already is