I think you can exploit fall-through for this. Maybe. At least, try it.

/cast Summon Voidwalker
/cast Summon Imp

If it works, it should summon the VW if possible, ending the macro since you can't have multiple GCD casts in the same action. Otherwise, it should try to cast the second spell (succeeding if you're not OOM or CCed). If this doesn't work, I don't know of anything that would - conditional execution is something they want to avoid. About the most you can do along that line is stuff like different actions for friendly/enemy targets et cetera.