Wow, this is pretty cool news if it turns out to be useful. I just saw a Moto X in a pawn shop the other day, one of my favorite phones of all time and now because of this thread I'm thinking about going to get it.
Might just have to do that if I can talk 'em down on the price to make it worthwhile, if I do get - and it works fine and isn't already unlocked (fat chance of that but you just never know) - I'd love to see if it'll work with this methodology the OP has come up with.
Guess I'll take a walk over and see what's up with that Moto X, think it's an AT&T version but I can't remember precisely.
Good luck with things, regardless...
EDIT:
Ok, so I went and grabbed that Moto X, it's an AT&T XT1058 as we all know, black model, nary a mark on it so whoever owned it previously sure did a great job taking care of it thankfully. I'll post the unlock info just in case the OP cares to give it a go but if not I can wait till he/she might have that automated method available.
The unlock info for this XT1058 is:
3A35120695322625#543031313330474A534700585431303538000000#8824CC4590B14CA4D15FAD760B586CEB67232790#635986040C0001000000000000000000
and of course I checked it with Motorola and they obviously won't allow it to unlock since it's the AT&T variant. But anyway, there it is, so fingers crossed I suppose. I missed my original Moto X, still have some accessories for it including a Griffin desktop stand I got for my original one from Motorola for free so I might have to dig that out of a closet and make use of it again. Small phone nowadays compared to modern monster 5" and larger beasts but I do still love the Moto X and I'm glad I got another one.
(for whatever reason, when I look at that code above it has 2 spaces in it as displayed by my browser which if Firefox ESR but it doesn't have any spaces when I copied/pasted it, and I see the same thing for other codes posted above - just wanted to say that for some reason, 132 digits long)