Muslims don't really expect non-Muslims to know what to do, and etiquette will vary from mosque to mosque. It's really not a big deal if you slip up unintentionally; at worst, someone will politely explain it to you.
With regards to dress, here's the NewMuslims.com guidelines for new Muslims:
The general rule is that a Muslim should be clean, wear clean clothes, and not smell bad when he or she comes to the mosque. He should avoid everything that has an offensive smell like that caused by eating raw garlic, raw onions, or smoking.
This seems like good advice for the non-Muslim too. Just dressing respectably and modestly should be fine, and if there's anything specific the people at the mosque will let you know.
I would advise against wearing shorts, but probably no-one will care unless you enter a prayer area:
For tourist the rules are less strict, but when you plan a trip to a mosque try to dress modestly. The hair of the women as well as the shoulders and knees of both genders should be covered. If this is not the case, some mosques provide scarves and attires free of charge. -- The Istanbul Insider
What else you would need to know:
In indoor spaces in the mosque, you'll need to take off your shoes.
Don't make a lot of noise. And ensure your mobile phone does not ring in the prayer areas.
Avoid walking in front of anyone praying. See: Is my congregational prayer invalid if a person walks in front of me?
Ordinarily, it's okay to take photos of the mosque, and photos with friends while you're there, but avoid taking photos of random people.
Touching the Qur'an should be done in a state of purity, but it's probably not a big deal for non-Muslims, provided they treat it with respect: Can Non-Muslim read Qur'an without wudu?
There's often a place to donate to the mosque and the charities it supports.
Some people might be uncomfortable with seeing images of beings with souls during prayer. [E.g. I took a keyring with chicks (i.e., baby chickens) into mosque, and the lady next to me moved it out of view. This also gives an idea of what might happen if one slips up.]
For women:
Women should be careful not to enter the men's prayer area, which might not be so obvious to non-Muslims. (Actually, this is true for men, but usually the women's spaces are far too difficult to walk into unintentionally.)
In some mosques, women will be required to cover their hair. So remember a headscarf (or borrow one).