Most likely when your clients reconnects from a software abort, your name is still "ghosted" on the server. So when you try to reconnect, the server says your name is in use, and chooses a new name. There are multiple solutions:

1. Add a script that confirms your nickname when you connect. If it's not your desired name, have it change you. Some servers offer a /nickserv ghost <name> <password> command to kill the clone. Once killed, you can /nick.
2. Setup a notify list with your name, When your name disconnects, your notify list will tell you, and you can then switch names.
3. Run a timer on connection and re-attempt to cange your name until a success.

If it doesn't involve your nickname, more information is needed to solve your problem. Try using /debug @d to see what is and isn't sent to the server.