Well, if I recall, the Tommy Gun has a 10" (or 12" w/ the comp) barrel and the Grease Gun has an 8". I don't know if that maximized velocity/energy or was just the barrel length that was most managable. Granted, this was on a SBR type weopon.
edit-
I chrono-ed my 1911 5" barrel vs a 6" barrel and the velocity went up by around 75-80 fps. I'm thinking a number between 8 and 10 inches should be fine.
Being used on an AR weopon, using a ACE buffer set up, an AR 45ACP pistol could end up just as long as the Tommy gun or just under.