You probably have the easiest way right there in your hands. If you don't need to check for specific factions there are a couple of conditions (OnWarFooting or similar), but for specific factions there's really no way around it. If you start doing these kind of repetitive scripts you should learn how to do script generators, with php, C++, excel or similar.