Stuck in Teleporter Loop

I got a teleporting script in C# from another user here…
it works except that i have been stuck in an endless loop of telporting back and forth

i have figured i need make the script pause long enough to let the player exit the trigger area so that it will stop it from looping endlessly

How am I to make this script pause itself?

using UnityEngine;
using System.Collections;

public class teleporter : MonoBehaviour
{
	//this is the exit object
	public Transform exit;
	
	//This is the player
	public Transform TeleportMe;
	
	
	//teleport if in the teleporter this way, because 2D rigid bodies weren't returning trigger
	void OnTriggerEnter2D(Collider2D other)
	{
		TeleportMe.position = exit.position;     
	}
}

Typically for these types of problems you need to do one of two things. Either:

A) Create a boolean on the player that prevents him from teleporting, set it before the teleport, test it in the OnTriggerEnter, and unset it when the player leaves the trigger.

or

B) Create a boolean on the teleporter that prevents any teleporting through it while somebody is in it, set it on the exit teleporter when a player uses a teleporter, test it in the OnTriggerEnter, and unset it when the OnTriggerExit is called.

using UnityEngine;
using System.Collections;

public class teleporter : MonoBehaviour
{
	public Transform exit;
	public Transform TeleportMe;
	private static bool justTP;

	void Awake(){
		justTP = false;
	}

	IEnumerator OnTriggerEnter2D(Collider2D col)
	{
		   
		if (!justTP){
			justTP = true;
			TeleportMe.position = exit.position; 
			yield return new WaitForSeconds(0.5f);
			justTP = true;

		}

	}

	IEnumerator OnTriggerExit2D(Collider2D col)
	{
		
		if (justTP){

			justTP = true;
			yield return new WaitForSeconds(0.5f);
			justTP = false;
		}
		
	}

}