How to reset the scaling after 1second

I don’t know what I did wrong.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Paddle : MonoBehaviour {

    // configuration paramaters
    [SerializeField] float minX = 1f;
    [SerializeField] float maxX = 15f;
    [SerializeField] float screenWidthInUnits = 16f;
    [SerializeField] float shrink;
    private bool small ;
    private Vector3 originalscale;
    public float timer ;
	// Use this for initialization
	void Start () {
		
	}
	
	// Update is called once per frame
	void Update () {
        float mousePosInUnits = Input.mousePosition.x / Screen.width * screenWidthInUnits;
        Vector2 paddlePos = new Vector2(transform.position.x, transform.position.y);
        paddlePos.x = Mathf.Clamp(mousePosInUnits, minX, maxX);
        transform.position = paddlePos;
	}
    public void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.gameObject.tag.Equals("enemy"))
        {
            originalscale = transform.localScale -= new Vector3(0.5f, 0, 0);
            small = true;

        }
        if (small==true)
        {
            timer = 1f;
        }
        if (small)
        {
            timer -= Time.deltaTime;

            if (timer <= 0)
            {
                transform.localScale += new Vector3(0.5f, 0, 0);
            }

            if (transform.localScale == originalscale)
            {
                small = false;
            }
        }
    }

}

You should get the originalScale in the Start method:

void Start(){

originalScale = transform.localScale;

}

You should only use the trigger script to scale smaller, set your timer and set your bool and if you just want the transform’s scale to change on the x axis, do it like so:

public void OnTriggerEnter2D(Collider2D collision)
     {
         if (collision.gameObject.tag.Equals("enemy"))
         {
             transform.localScale = new Vector3(0.5f, transform.localScale.y, transform.localScale.z);
             small = true;
 timer = 1.0f;
                     }
            }

In the update method, you should include the small Boolean logic, but apply the originalScale vector to localScale when the timer is finished:

void Update(){

         if (small)
         {
             timer -= Time.deltaTime;
 
             if (timer <= 0)
             {
                 transform.localScale =  originalScale;
                 small = false;
             }

         }
}