Tom, I believe you've cracked it. The Enlistment details identify the enlisting soldier as John Wright born 22 Sep 1832 at Culbeuchly - cannot see much doubt about that. That Louisa Wright née Andrew was (still) there in 1841 right until she died in 1868 means there's no real doubt that the enlisting soldier is Louisa's son.
And, given the 1851 baptism record of John Wright citing his regiment, there's also no doubt the enlisting soldier is the father of your John Wright.
Regarding where he lived when he enlisted, and noting he seemingly wasn't around in the 1851 census, he could well have disappeared into the metropolis. I must admit I would have thought he would have enlisted more locally if he was around locally. It's possible he had already had a stint in the military somewhere before ending up in Edinburgh.
I think we mentioned before he was much younger than Isobel Simpson, although can't see why that would have any bearing on things.
But, to pique your interest, I've found out what happened to his brother William Wright!
He married Margaret Farlie - M-1864-732(Coldingham)-12 (this confirms his parentage).
He died 1900 age 70 - D-1900-732(Coldingham)-1 (look at the muddle of his parentage as recorded!).
Scotland's People references. Coldingham is in Berwickshire.
You'll find him and his family there in 1871, 1881, 1891.
Note in 1900 he's recorded as --- Army Pensioner.
Being an out-pensioner, he might have been paid his pension by the taxman, and those taxman records are available at Kew. Since he's doesn't seem to be around in 1861, he might have joined the army at much the same time as his brother.
I'll leave you to figure that out! If you can't see the censuses, give me a shout and I'll extract the information.
I checked up to see if I could see any connection with my Wright lines and my Andrew lines. I couldn't see any, although my main Andrew line splits leads going back with Walter Andrew the husband's line going back to Cullen and Janet Andrew his wife's line going back to places in Fordyce neighbouring Banff landward where Culbeuchly is (they married in 1730 in Cullen).
As for Wright, no connection that I can see.
But seems you've cracked the John Wright brick, and now you've another little mystery with William Wright. Good luck!