1) Have a reputable electrician come and have a look at the house you really want to purchase and let them explain to you what you might be dealing with before you buy. (I do recommend getting a home inspection first, then calling an electrician only after you know the home inspection has passed.)
2) Hire your own inspectors. Do not take referrals from anyone involved in the deal, even your trusted realtor. Do your own homework and get your own references.