Trying to make a script toggleable. Need some help.

The end result would be identical with the changes I mentioned, it would just be laid out differently. Understood though. Try one of these.

// User input for toggling reverseForce, add it as a new method anywhere in the script.

void Update() {
    if(Input.GetMouseButtonDown(1))
        reverseForce = !reverseForce;
}

or...

// Change to the reverseForce check to include a check for mouse button 1. Requires holding the button.

if (reverseForce || Input.GetMouseButton(1))
{
    forceMultiplier *= -1;
}

For stopping the force when a button is held, the option with the smallest change would definitely be to just exit out early by using return, as djgreedo suggested. If you don't plan to change the script or add anything else to FixedUpdate, the downsides are a non-issue.

Just for the sake of completeness though, this is how the if statement would look.

if(Input.GetMouseButton(0))
{
    float forceMultiplier;
    Vector3 forceDirection;
    foreach (Rigidbody a in objectsInRange)
    {
        forceMultiplier = (-strength / Mathf.Pow(Mathf.Max(Vector3.Distance(_transform.position, a.position), 1f), strengthExponent));
        if (scaleStrengthOnMass)
        {
            if (GetComponent<Rigidbody>() != null)
            {
                forceMultiplier *= _rigidbody.mass;
            }
        }
        if (reverseForce)
        {
            forceMultiplier *= -1;
        }
        forceDirection = (a.position - _transform.position).normalized;
        a.AddForce(forceDirection * forceMultiplier);
    }
}
/r/Unity3D Thread Parent