This doesn't do exactly what you want but it could help and might even be better. Make your objects with features you can turn on and off. If you're working with 2D symbol objects, you can create your object assigning each discrete feature to a fragment and turn the fragments on and off in the 2d GDL script.
The reason this might be better is you maintain the integrity of the rest of the detail shutting off only the part that doesn't apply. Better still, if you have similar but different conditions that occur regularly, like one foundation detail that uses a 2x4 sill and another that uses a 2x6 sill, create fragments for both conditions and write the 2D script to select the one you want.