First off, this should've been put as a New Post, not as a reply to a post/topic already started.
Secondly, it's a lot easier to read and work with code when the Code Tags are used.
I regret that I can't offer you a solution to your problem, however, I would like to offer you the following code, which is a re-write of your current code, condensing common elements, re-writing for a 'better' script (ie: proper usage of the if/elseif/else format and removal of the halt statements)

Code:
 on ^*:text:*:#: {
  if (%highlightsoundstatus == on) {
    if (%highlightsound) {
      $iif(%highlightsound == beeeep,beep,splay " $+ %highlightsound $+ ")
    }
  }
  if ($me isin $strip($1-)) {
    if $away {
      notice $nick as away su priezastim: 4-= %awaymsg =- . Manes nera jau 4-= $duration($awaytime,1) =- 
      write -a awaylog.txt $timestamp < $+ $nick $+ > $1-
    }
    flash $chan
    window -g2 $chan
    echo # 4 $+  $timestamp $+ 10 $chr(171) $+ 4 $+ $iif($nick isop #,$chr(64),$iif($nick isvoice #,$chr(134))) $+ $nick $+ 10 $+ $chr(187) 0 $1-
  }
  else {
    window -g1 $chan
    echo # $timestamp $+ 10 $chr(171) $+ 4 $+ $iif($nick isop #,$chr(64),$iif($nick isvoice #,$chr(134))) $+ $nick $+ 10 $+ $chr(187) 0 $1-
  }
}