Error code 60000 means that your friend code isn't recognised by the server. The only way to fix this is to delete your save file.
Lag is affected by your internet connection's roundtrip latency speed, or "ping", and also by your distance from your opponent. Go
here and run the test, and have your friend run it as well. If it's more than 100-150ms, your, or your friend's, connection isn't suitable for online gaming. Likewise, if your friend is based in a different country, lag will be quite high as well. There aren't really any fixes for this, other than maybe to upgrade your internet connection. Brawl online play is quite laggy anyway, so some lag will always be present.
also, please don't double-post. If you want to add to your previous post, edit it instead of posting again.