Does sociality evolved before or after the ability of motility?
I'm going to hazard that primordial sociality by this definition and this question proceeded primordal motility in cells.  

Algae started to form physically attached groups like these filaments, giving them some of the advantages of higher organization.  



Its easy to see how this is a relatively simple adaptation - just have proteins or carbohydrates on the cell surface that stick together.  This might also have evolved from large cells compartmentalizing since we're talking about very ancient stages of life on earth.