The name of the town comes from its ancient Roman name, Emerita Augusta. The first element means "bachelor" in Latin, this referring to discharged soldiers. I'm guessing that the town was originally a station for discharged Roman soldiers. So Merida basically means "bachelor". The town in Spain has lent its name to towns in Mexico and Venezuela. Merida, however, is not used as a first name in Spanish.
I think the reason why you suspect that it's Scottish is because of the similarity to the Scottish name Mairead, which is a form of Margaret.