Formation of very strongly magnetized neutron stars - Implications for gamma-ray bursts