Form a graph of the teleporters:
- You have a node for each teleporter and a node for the end position.
- You have an edge connecting each node to each other node, forming a fully connected graph.
- For the edge weights, use the Manhattan distance between each node's destination cell (the one you go to when you enter the teleporter) and all the other nodes.
Use Dijkstra's algorithm to calculate the shortest distance from each node to the end.
You can now use the minimum of the distance between a particular position and all the nodes plus the pre-calculated distance from the node to the end as a heuristic function. Dijkstra's algorithm only has to be run once as a pre-processing step. However, if the number of teleporters is a large perecentage of the number of cells, you may not get any benefit over using a simpler heuristic function.