You don't need a script to make a wall invisible. Anything can be made invisible in MAX and be used as a barrier. All you have to do is, once selected, go to the Object Tools on the right side, open the Materials panel, and drag Alpha Clipping all the way to the left (to 0). That will make the object completely invisible. For best results, make sure the object is set to Static and choose whatever collision method is best for this objec.
Intel i9-10900K 5.10GHz, 64 GB RAM, Nvidia GTX 1080 ti 11GB, Windows 10 64-bit, dual monitor display