This is a great example of why not to use IsClass.  It's incredibly fragile; if anyone ever adds another wall element in the future, this is guaranteed to break.

Instead, add a new function, something like IsStackableElement() with a comment about what it does, have it return FALSE near the top of the hierarchy, and have these classes override it to return TRUE.  Then the responsibility for the behavior is with the wall element classes, where it belongs.