I was bored.. :P

Code:
hand {
  ;var %hand = 2-S.1-C.13-C.4-D.8-H
  ;var %hand = 2-S.A-C.K-C.4-D.8-H
  var %hand = $$1

  echo -a -
  echo 3 -a Cards: %hand

  var %sa = 1, %sb, %t

  ; Check for high card, 1 pair, 2 pair, 3 of a kind, 4 of a kind, full house
  %t = $remove(%hand,-C,-D,-H,-S)
  %t = $replace(%t,J,11,Q,12,K,13,A,14)
  %t = $sorttok(%t,46,nr)

  var %c = 15, %w
  while (%c > 0) {
    dec %c
    %w = $wildtok(%t,%c,0,46)

    if (%w == 4) {
      %sa = 8
      %sb = $instok(%sb,%c,1,46)
    }

    ;3 matching cards
    elseif (%w == 3) {

      ;Full house
      if (%sa == 2) {
        %sa = 7
        %sb = $instok(%sb,%c,1,46)
      }

      ;3 of a kind
      elseif (%sa <= 4) {
        %sa = 4
        %sb = $instok(%sb,%c,1,46)
      }
    }

    ;2 matching cards
    elseif (%w == 2) {

      ;Full house
      if (%sa == 4) {
        %sa = 7
        %sb = $instok(%sb,%c,2,46)
      }

      ;2 pair
      elseif (%sa == 2) {
        %sa = 3
        %sb = $instok(%sb,%c,2,46)
      }

      ;1 pair
      elseif (%sa <= 2) {
        %sa = 2
        %sb = $instok(%sb,%c,1,46)
      }
    }

    ;1 matching card and no other matches
    elseif (%w == 1) {
      %sb = $addtok(%sb,%c,46)
    }

    ;remove current card from hand
    while ($istok(%t,%c,46)) %t = $remtok(%t,%c,1,46)
  }
  if (%t != $null) echo -a Invalid card(s): %t



  ;Check for straight, straight flush, royal flush

  var %suits = $remove(%hand,14,13,12,11,10,9,8,7,6,5,4,3,2,1,A,K,Q,J)
  var %f = $iif($count(%suits,$gettok(%suits,1,46)) >= 5,1,0)

  %t = $remove(%hand,-C,-D,-H,-S)
  %t = $replace(%t,J,11,Q,12,K,13,A,1.14)
  %t = $sorttok(%t,46,nr)

  var %s = 0, %prevcard, %card, %c = 0

  while (%c < 6) {
    inc %c
    %card = $gettok(%t,%c,46)

    if ((!%prevcard) || (%card == $calc(%prevcard - 1))) inc %s
    %prevcard = %card

  }

  if ($gettok(%t,1,46) == 14) {
    if ($gettok(%t,2,46) == 13) %t = $deltok(%t,6,46)
    else %t = $deltok(%t,1,46)
  }

  ;5 sequential cards
  if (%s >= 5) {

    ;royal flush
    if ((%f) && (%t == 14.13.12.11.10)) %sa = 10

    ;straight flush
    elseif (%f) %sa = 9

    ;straight
    elseif (%sa <= 5) %sa = 5

    %sb = %t
  }
  ;flush
  elseif ((%sa <= 6) && (%f)) {
    %sa = 6
    %sb = %t
  }


  var %hands = High Card,One Pair,Two Pairs,Three of a Kind,Straight,Flush,Full House,Four of a Kind,Straight Flush,Royal Flush
  echo 5 -a Hand: $gettok(%hands,%sa,44) 
  echo 7 -a Comparison: %sb

  return %sa $+ : %sb

}


Usage: $hand(<card>-<suit>.<card>-<suit>.<card>-<suit>.<card>-<suit>.<card>-<suit>)
Returns: <hand score>:<comparison string>

Example 1: $hand(A-C.Q-C.K-C.10-C.J-C)
Result 1: 10:14.13.12.11.10

Example 2: $hand(2-H.6-D.8-S.2-S.K-C)
Result 2: 2:2.13.8.6

The identifier accepts 2-10 and A,J,Q,K for card values and C,D,H,S for suit values. Ace (1) is tested as high and low in straights, and considered high in pairs, etc. Note that there is no error checking to ensure that the values given to this identifier are valid. Invalid values will return unexpected results.

The <hand score> returned is a number from 1-10 that corresponds to "(1) High Card,One Pair,Two Pairs,Three of a Kind,Straight,Flush,Full House,Four of a Kind,Straight Flush,Royal Flush (10)".

The <comparison string> is has a different format for different <hand scores>. The relevant numbers are farthest to the left, and the extra numbers are farthest right. The number of relevant and extra numbers varies depending on the hand. In most of the hands in poker, if the relevant cards (pairs, three of a kind, etc) are a tie between two players, the extra cards are used to decide who has the higher hand.

------
Comparison string formats:

Royal Flush = All the cards
Straight Flush = All the cards
Four of a Kind = value of the 4 relevant cards, 1 extra
Full House = value of the 3 relevant cards, value of the 2 relevant cards
Flush = All the cards
Straight = All the cards
Three of a Kind = value of the 3 relevant cards, 2 extra cards
Two pairs = value of highest 2 relevant cards, value of second 2 relevent cards, 1 extra card
One pair = value of 2 relevant cards, 3 extra cards
High card = All the cards
------

** All extra cards are in decending order.

To compare two hands get the value of each hand using the above identifier. Then create another identifier which first compares the <hand score> of each hand. If one hand has a higher <hand score> than the other, that hand wins immediately. If the two hands have the same <hand score>, then another comparison must be done to compare the relevant cards from each hand. If all of the relevant cards are the same in each hand, then the extra cards must be compared. If all the extra cards are the same in each hand, then the hand is a tie.
** The comparisons of the relevant and extra cards will have to depend on the <hand score> because the format of the <comparison string> varies. I don't have time to write the comparison identifier right now, but I can do it tomorrow if you want.

There may be some rules of poker that I am not familiar with, so let me know if there are any errors in the results. I used this page as information while making the code.

-genius_at_work