MagnusPloug2
First off, if you're playing with battalion-sized units then the artillery models probably represent a battery of two. So you have to think what the general orders given them before the battle would be and what their shots would aim at on average. Firing at the second rank would be an unlikely general order for these reasons:
Batteries will want to maximise casualties and given round-shot often follows through to the men behind, it makes sense to fire round-shot at the enemy front row. Artillery is also intended to blunt an enemy's teeth: ie its ability to fire or charge; both properties of the front rank.
As for before a melee, you would think an artillery crew would be trying to disorder or take kills off the enemy unit that's likely to be fighting first.
As for while a melee is taking place, you're talking about a very specific situation where your artillery is on high land and can see over the on-going melee to the enemy behind. Well, I guess you'd have to have a rule for how far that enemy can be to your side, yet still be close enough to the forward enemy to give "support".
Shako rules which are also for battalion-sized units just say artillery has to fire either at the nearest enemy or at an immediate threat to the battery. That seems right.
It has some good ideas, here:
link
As for supporting units, yes, I think they'll have an effect; whether from behind or from the flanks. But the effect should be very slight: a single point for each type of support would be enough.
Also think about round-shot run through: perhaps a minus point off casualties from the unit behind.