This is great and a LONG needed addition to the set of tools. If you want any help interpreting any undocumented script codes or improving source code readability I'd be happy to offer my services.
    WriteTo(TempByte(0), SpecialByte($Random8BitNumber) * 9 >> 8)
    WriteTo(TempByte(3), TempByte(0))
    WriteTo(TempByte(4), TempByte(3) + 1)
    ...
    WriteTo(TempWord(22), Unknown1b(TempByte(3)))
    WriteTo(TempWord(24), Unknown1b(TempByte(4)))
    If TempWord(22) - TempWord(24) >= 128 Then
      WriteTo(TempWord(22), TempWord(22) - 256)
      GoTo @LABEL_3
    EndIf
    If TempWord(24) - TempWord(22) >= 128 Then
      WriteTo(TempWord(24), TempWord(24) - 256)
    EndIf
    @LABEL_3
    WriteTo(TempWord(14), TempWord(8) - 256)
    WriteTo(TempWord(16), TempWord(14) * TempWord(22))
    WriteTo(TempWord(14), 256 - TempWord(14))
    WriteTo(TempWord(18), TempWord(24) * TempWord(14))
    WriteTo(TempWord(20), TempWord(16) + TempWord(18) >> 8)
    SetEntityDirection(TempWord(20))  If SavemapBit($OwnChocoboStable, 0) Then
    EnterFieldLevel($ChocoboFarm, 1)
    GoTo @LABEL_2
  EndIfIf SpecialByte($LastFieldID) == $IcicleVillageNorth Then  if ( CurrentActor.X - Destination.X <= 0 )
    v5 = -(CurrentActor.X - Destination.X);
  else
    v5 = CurrentActor.X - Destination.X;
  deltaX = v5;
  if ( v5 >= 24000 )
    deltaX = 48000 - v5;
  if ( CurrentActor.Y - Destination.Y <= 0 )
    deltaY = -(CurrentActor.Y - Destination.Y);
  else
    deltaY = CurrentActor.Y - Destination.Y;
  if ( CurrentActor.Z - Destination.Z <= 0 )
    v3 = -(CurrentActor.Z - Destination.Z);
  else
    v3 = CurrentActor.Z - Destination.Z;
  deltaZ = v3;
  if ( v3 >= 1C000 )
    deltaZ = 38000 - v3;
  return deltaZ + deltaY + deltaX;That's my best guess, but I'm not sure what that output would tell you. In the context of Emerald Weapon they seem to be some form of circular path and direction finding.