Generally your best bet for finding legitimate companies comes from looking at sites with lists of legitimate ones. You have done that, so are well on your way. The list on this forum is in the first post of the first thread of "Mystery Shopping Company Discussion". There are also lists of legitimate companies at Volition.com and at the MSPA site (that is the trade association for companies that provide mystery shopping work to shoppers). Realize that "legitimate" does not equate to 'fair' or 'paying per contract terms'. Your best bet for that is researching companies on this forum or on Volition.com.
And of course since you 'almost' got scammed you were able to recognize that which was 'too good to be true'. That takes a healthy skepticism, so you should be fine.