Did you read my comment about missing a = sign in my method? If not it has the same flaw. It would've outputted false. It needed to be <= instead of < for the testing for valid crossing.

My paste was too old to allow me to edit in the fix at the time which is why I posted what needed fixed, and opted to show where, since it was just one forgotten character, instead of re-pasting the entire code.

//echo -a $inpoly(-26,78,-66,58,-26,58,-26,98,-66,98)
Output:
$false

//echo -a $mslinpoly(-26,78,-66,58,-26,58,-26,98,-66,98)
Output:
$true

the line that needed changed was:
if (%x < $calc(%ax + %vt * (%bx - %ax))) { inc %cn }

to:
if (%x <= $calc(%ax + %vt * (%bx - %ax))) { inc %cn }

Here it is Copy/Paste friendly, so ya don't have to manually insert the equals sign

Code:
alias MslInPoly {
  ;=== setup variables and complete polygon
  var %cn = 0 , %x = $1 , %y = $2 , %size = $0 , %poly = $3- $3-4

  if (%size > 2) { 
    var %i = 0 , %j = %size - 2
    while (%i < %j) {
      var %ax = $gettok(%poly,$calc(%i + 1),32) , %ay = $gettok(%poly,$calc(%i + 2),32) , %bx = $gettok(%poly,$calc(%i + 3),32) , %by = $gettok(%poly,$calc(%i + 4),32)

      ;=== Condition1 = Upward Crossing, Condition2 = downward crossing
      if (%ay <= %y && %by > %y) || (%ay > %y && %by <= %y) { 

        ;=== Compute the actual edge-ray intersect x-coordinate
        var %vt = $calc((%y - %ay) / (%by - %ay))

        ;=== Test for valid crossing
        if (%x <= $calc(%ax + %vt * (%bx - %ax))) { inc %cn } 

      }
      inc %i 2
    }
  }
  var %cn = $and(%cn,1)
  if (%cn > 0) { return $true }
}