Rosetta Stone Challenge: Run-Length Encoding v2.0
Python 214

def t(s):
 b=s;l=len;r=range(1,l(s))
 for i in r:
  p=s[:i];b=min(b,p+t(s[i:]),key=l);x=1
  for j in r:k=i*j+i;x*=p==s[i*j:k];b=min(b,(b,''.join((`j+1`,"{"[i&lt;2:],p,"}"[i&lt;2:],t(s[k:]))))[x],key=l)           
 return b


(second level indent is tab)

As this is code-golf, this is the naive recursive approach without early-exit, so its really really slow.