Viewing Special Characters
The good news is that this part should almost always 'just work' on OS X and iOS devices. Encodings are usually handled intelligently, Unicode fonts are installed, and font substitution does its job.
If you do encounter problems, be sure to specify the encoding as Unicode (UTF-8)
when saving. If your text editor doesn't allow you to specify an encoding, it's a fairly safe bet that this is what it's using.
Since Markdown files are plaintext, you don't have to worry about fonts. If you are using rich formatting, though, Lucida Grande, Arial Unicode, and Apple Symbol are all good options. But, again, OS X and iOS generally switch to another font seamlessly when the main font doesn't support a character.
Entering Special Characters
Both OS X and iOS include built-in text replacement tools that will let you insert your symbols easily.
OS X
Open System Preferences-> Language and Text-> Text and click the [+] button. Choose a keyword to be expanded and paste in the special character. You'll have to create snippets with unique keywords for each character.
iOS
Copy a special character. Open Settings-> General-> Keyboard-> Shortcuts and tap the [+] button. Paste the character under Phrase and enter a unique keyword under Shortcut. Tap save. Again, you'll have to create snippets with unique keywords for each character.
If you like, you can use the excellent TextExpander to do the same thing, but it isn't necessary in this case.
Option/alt + ñ on the Spanish ISO layout, followed by a or o gives you ã and õ.
To make a custom layout, use Ukelele
http://scripts.sil.org/ukelele
PS If you are running 10.7, you can also get those characters by holding down the a and o keys until the Character Picker popup menu appears.
Best Answer
Switch to the 2-Set keyboard layout. Let us know in detail if there is anything about that which is not working the way you want.