There is a conditional "grouparty/raid— You are in the given type of group "



So I think you can do /stopmacro [group:raid]

or...I thought I had this working, although I am not certain

/follow [group:raid, target=raid1] [target=party1]