The simplest fix might be changing the behaviour to just breaking the locks.
One possibility would be of course decreasing maximum locked targets. (Counterable with autotargeters and signal amplifiers, in addition to ECCM.) This mechanic would likely need some kind of degrees of success, where the amount of maximum locked targets gets decreased more the more ECM beats sensor strength (with diminishing returns).
As for scripting, we might have a script to break locks (but allow locking while module cycles), and another script to decrease the amount of maximum locked targets (for the duration of the cycle). Case one works well with sensor damps (making locking slower, so time when locks are broken is increased). Case two is a bit more specific and makes possible to shut down ships altogether, but would ideally be balanced such that to shut down a ship you need a whole ship's worth of jammers. (If the targeted logistics ship is reduced to but a few targets, but not completely shut down, sensor damps would again have a role to increase locking and thus response time.) One way to help balance this could potentially be done by having the "lockbreaker" scripts have a bonus to ECM strength, but the "lock removing" script being restricted to (potentially nerfed) baseline.
(Default unscripted behaviour would need some thought - perhaps one of the above. This would be used for the ECM drones, as well.)