Was start by buying a .22, that way I could spend the money on ammo and basic range accessories to begin with while building some basic shooting skills. Remember to budget for ear muffs, glasses, range bag, targets, ammo, case, any lock box/cabinet/safe, trigger/cable locks, cleaning supplies, range membership...
Once I had the .22 I could learn how the range works, and more easily decide what I liked and didn't like about the gun. So when buying the next gun after a few thousand .22 rounds, and renting a few others, I had far more experience shooting and handling guns and had a better understanding of what I was looking for. I bought my .22 with the understanding that it was not to be my only gun, but a start in learning more. I fully expected to sell it when I found another gun, but I still use it a lot just to work on trigger control and sight alignment.
As far as your choices:
I don't think you'll see much benefit in reality from the slightly longer barrel, my Glock 19 has a 4" barrel and still shoots far better than I do... I'm just thinking that if you want a target gun, I tend to think there are better choices than Glock.
Because I'm a fan of wheelguns, I also have to ask: Have you considered a revolver? A good .357 with a 4-6" barrel can be found for about $400, giving you the option of shooting soft (and cheap) .38 special target loads, or very hot .357 loads in the same gun.