How does an axon "know" it's not connecting to its own neuron?
I think I can partially answer you question. As far as I'm aware, there are many surface receptor molecules such as ephrins that are responsible for axonal guidance and dendritic repulsion in developing organisms such as flies (Drosophila). As you can tell this is extremely crucial since its important for neurons to spread their dendrites and axons as far as possible, evenly spaced out with axons bifurcating (separating) correctly and not sticking together. This is for example important in the Drosophila brain for axonal projections into different lobes.

One such surface receptor, which helps achieving the above is Dscam (Down syndrome cell adhesion molecule) (schmucker et al 2000 Cell). Dscam gene is expressed in over 38000 isoforms (through complex alternative splicing of Dscam mRNA) in flies. It is the homophilic binding and subsequent repulsion of Dscam protein isoforms that enables an intrinsic self-recognition for repulsion of same-cell axon. As far as I understand it, if a number of similar Dscam isoforms are present on axons or dendrites of a neuron, this is self recognised and the dendrites and axons get repelled from one another. This is the molecular pathway that ensures sister dendrites are not adhered together or become concentrated in one area.

In the absence of Dscam or when Dscam protein isoform diversity is removed flies die during larval stages and the early embryonic axonal patterning of the fly nervous system is clearly disrupted. In the absence of Dscam protein, Bolwig's axons exhibit frequent axon pathfinding errors at a specific intermediate target. Most of these processes are conserved in mammals.

For further information please look at Schmucker &amp; chen, 2009 Genes and Dev