It'll stop when the target is destroyed (as in, finished exploding, since things that are still exploding don't count as dead and will still be targeted, and can still fire beams etc. Silly, but that's how FSO works).
And then when it starts firing again it'll empty what's left of it's "clip" before reloading.
Well, at least, I presume it works like that, since that's how it works as a player-triggered primary.
Fires only as long as you hold down the trigger; after lifting trigger mid-clip, you fire the remainder of your clip before reloading a new one. Though, I must say, a key to manually reload the clip would be nice...