I've been messing around with that item upgrades by repairing a while ago and tried to find out what makes it more likely to happen, apart from having lucky time.
I found that items that have 0, 1 or 2 dura left and cost more than 20,000 to repair are more likely to up in quality.
I tried this out by collecting a bag full of items from different maps. Before repairing them with LT I noted there dura and how much the repair was going to be.
From a bag full of Bird Island items, about 1 to 3 went refined by repairing, and all of them were expensive to reapir, whereas from a bag of Phoenix Castle items none went up.
The attached pictures shows the message when an upgrade happens.