Here's some short scripts from a mission I was working on:
fire.sqs
_gun = _this select 0
_target = _this select 1
_dir = 0
_radius = 0
#Top
@_gun ammo "browning" > 0
_radius = (random 10) + 15
_dir = _dir + random 45
_gun dowatch [(getmarkerpos _target select 0) + _radius * cos _dir, (getmarkerpos _target select 1) + _radius * sin _dir, random 10]
_gun fire["browning","browning"]
~.1
goto "Top"
wigglemarker.sqs:
_mark = _this select 0
_theta = -1 * (_this select 1) + 90
_dist = (_this select 2) * 125
_speed = (_this select 3) * 10
_center = getMarkerPos _mark
_adjust = 0
_dir = 1
#Top
_mark setMarkerPos [(_center select 0) + (cos _theta) * _adjust, (_center select 1) + (sin _theta) * _adjust]
?_adjust >= _dist OR _adjust <= -1 * _dist : _dir = _dir * -1
_adjust = _adjust + (_dir * _dist / _speed)
~.001
goto "Top"
Okay, first place a marker, of type "empty" (they are invisible). Call it something like "target1". Now make the marker wiggle back and forth on the map, using wigglemarker.sqs. Call it with this line in an init field/script/trigger: ["target1", direction, distance, speed] exec "wigglemarker.sqs". "Target1" is the name of the marker (remember the quotes!). Direction is the compass direction you want it to start wiggling (0 is north, 180 south, 90 east, 270 west, etc.). Distance is the approximate distance the marker will move in that direction before moving back to it's origin. Putting a 1 will make it move about 1 map square, 2=2map squares, etc. Speed is how many seconds it takes for the marker to travel half its path (1 means it will travel out for 1 second, then travel back for 1 second).
Now to make the gun fire. When you are ready for them to fire, call the script like this: [gun, "target"] exec "fire.sqs". Gun is the name of the MG to fire, and "target" is the name of the marker it will fire at (remember the quotes!). This script will make the MG fire in sort of a circular pattern around the target, with a varying radius. The bulets will land anywhere from 10-25 meters from the marker. To change this distance, edit the _radius variable in fire.sqs. Since the markers are moving, the center of the "circle" the gun is firing at will also move, and you will get a nice effective spray along a rectangle of ground.
Oh yeah, you also should add some more ammo to the guns, or else they will run outta ammo quick. Put this in their init line:
this addmagazine "browing"; this addmagazine "browing"
Add more magazines as needed. Have fun!