How to change the teleporters to only teleport to each other?
There are several things you can do here. You've got a bunch of information about the teleporters and traps at your disposal. You could do something that exposes the links that have been created, or you could override those links.
Additional hints, protected by spoiler space:
The previous level shows you how to draw lines on the canvas, so you could draw lines to represent the connections this loop is creating. I think this is what the title of the level ("pointers") is getting at.
Drawing lines for each link is kind of overly verbose, so you might want to check the type and only show the links that are between teleporters.
If you can expose all the teleporter-to-teleporter links, there's a chance you can make it to the bottom right, but it's hard to see the lines and kind of a crapshoot as to whether or not the teleporters actually connect.
Since you know where all the teleporters are (getCanvasCoords), can't you find the fastest route? You want to go from the extreme upper left to the extreme lower right, correct?
What I did was hijack the loop in the code, and use it to find the upper left teleporter and connect it to the lower right one directly, then break out of the loop before any other connections are made. It's a bit brute force, but it worked: https://gist.github.com/agent86ix/0c1615791c05664c99fb