Good lord, that sounds cumbersome, and you'd have to recalculate the position of both the firing ship and the target every single time, while with my idea you'd just call a single sexp, specify the firing turret and intended target, and the scripting and turret AI would handle the rest, and then add a repeat count so that the same turret can fire at the same target over and over, just like with fire-beam. That this is done through a sexp is especially important because in certain missions warships will overcharge their railguns, which means they will do more damage but the recoil will damage the firing ship, so the sabotage-subsystem sexp must be synchronized with the railgun firing.
Also there are two other problems, which are (a) railguns produce huge and extremely obvious muzzle flashes and to have them drawn in the wrong spot or not at all would be immediately noticeable, and (b) at one point an Orion uses overcharge, and one of the railguns is mounted on the same multipart where its BGreen is located in FS2. For the railgun to fire without the turret tracking the target would also look silly.