Code:
alias blah1234 {
  ; $1 = number to make number 1 ( no bounds checks occur add them if u want )
  ;
  var %i = $1 | dec %i
  while (%i) {
    hdel -s hashtablename $hfind(hashtablename,global.text. $+ %i $+ .*,1,w)
    dec %i
  }
  var %i = $1
  while ($hfind(hashtablename,global.text. $+ %i $+ .*,1,w)) {
    var -s %old.item = $ifmatch
    var -s %old.item.value = $hget(hashtablename,%old.item)
    hadd -s hashtablename $puttok(%old.item, $calc(%i - $1 + 1) , 3,46) %old.item.value
    hdel -s hashtablename %old.item
    inc %i
  }
}


The above makes some assumptions about the hash table, that it only ever contains one item that starts with global.text.N. (N being a number), ie inly one global.text.1.* , only one global.text.2.* etc