Which wire was melting?
In the stock, internal, between trigger and motor, between motor and battery, positive side of battery, negative side of the battery, etc.
How is the gun wired? Does the trigger break the negative or positive wire?
Melting connectors/wires are almost always caused by a short that doesn't involve the trigger contacts of the gun. Usually, it's some part where your connections are touching, or the positive/negative are connected somewhere where there's a pinch point, for someone with not too much experience doing wiring.
I'm assuming that it was one of the wires you put in, namely the negative side (black), inside the stock that melted. If that's the case, look at where the wire started melting... and look at the opposite side... that's where the short took place... and basically just dumped your battery into a small loop of wire. That's bad. Try shrink wrap next time... or wiring that isn't broken ANYWHERE.
Unless you had your trigger pulled, it's not a problem with the wires themselves not being able to handle the 9.6v. If the wire itself can't handle the voltage, it will blow out like a fuse... but with more fire, immediately when the trigger is pulled.