Cleaning the mess in the contacts
I'm working from memory here as I'm now running ICS on my phone so I may be a bit off here. If you go into your phonebook settings, you should be able to stop it showing your gmail contacts.

Now, to get them into gmail contacts just do the following. Go to your phonebook, this will now just be showing you the contacts stored on your phone. You should be able to export this as a VCF file. Copy this file to your computer. Now just log into your gmail account, go to contacts and then import the VCF from there. Then delete all the phone contacts and re-sync your phone to gmail. 

You may still have to do a bit of merging if you have part of a contact saved in gmail and saved in the phone memory but this will take most of the hassle out of getting them into gmail.