Since I was going to need a turret in my work like the one you described, I decided to work on it now for you.
It does not aim ahead like dj2k’s, but it has a base and barrel that can be rotated in any direction as you wanted. From his script you probably can make it aim ahead. Hopefully you understand how functions work so that you can just copy paste what I did into your project.
Keys for the .blend:
A - rotates Turret Cube to the left.
D - rotates Turret Cube to the right.
arrow keys - move Target Cube around.
page up and down keys - move Target Cube up and down.
P.S. I can make one for you that is 2.49 compatible if you ask for it.