I made some progress, it sort of functions, but it's not quite there.
My code starts off like this.
@>Control Variables: [0006

layerX] = Player's Map X@>Control Variables: [0007

layerY] = Player's Map Y@>Control Variables: [0008:trollX] = [TrollChest]'s Map X@>Control Variables: [0009:trollY] = [TrollChest]'s Map Y@>Control Variables: [0008:trollX] -= Variable [0006

layerX]@>Control Variables: [0009:trollY] -= Variable [0007

layerY]This will store the X and Y for both the player and the troll chest. It then subtracts the player's X and Y from the troll chest's X and Y, leaving the distance between them. Though it stores over trollX and trollY, which is very irritating. Is there any way I can have this store to a different variable? I want to take trollX - playerX, and store into distanceX.
Anyways, the rest of the code:
@>Conditional Branch: Variable [0008:trollX] == 2@>Set Move Route: [TrollChest] (Skip): : $>Move Right@>@>Conditional Branch: Variable [0008:trollX] == 1@>Set Move Route: [TrollChest] (Skip): : $>Move Right@>It just does this basic thing for the 4 cardinal directions. What it intends to say is "If player is ever within 2 tiles of TrollChest, move him away from player."
The problem comes in when the chest gets to a corner. It isn't smart enough to know it's running into a wall, so it gets stuck and is easily approached. Ideally, you only capture it when you reach the end of the puzzle, where I can simply turn the behavior off.
If there is a way to store (trollX - playerX) = distanceX, then I could activate Event Touch events manually placed in corners via switch for the chest to be moved out of the corner. Ideas?