Strange Macbook 13 Retina MagSafe port problem
Apple MagSafe cables have one central shielded cable &amp; one braided outer cable. You are simply breaking &amp; creating a connection when you touch the broken braided cable - the order anomaly is the MagSafe/MacBook logic/sensor only allowing a particular state to operate.

It is possible to crack open a MagSafe and solder a 3rd party cable (but it will probably have 2 shielded internal cores and no braiding). Search YouTube for video (and note the risk of electrical shock even after several days of the MagSafe not being used). You will need the correct replacement part, long nose pliers to forcibly crack open the white  MagSafe shell, soldering iron, desoldering pump, locktite adhesive &amp; activator, steady hands &amp; patience.

Alternatively pop into an Apple shop when they are least busy (in the UK 10am the shops are empty), borrow a MagSafe &amp; do an SMC reset. If that doesn't work, an Apple diagnostic test is required (power/logic board) - store staff may run one out of goodwill (hence go when they're not busy)