\starttext
\defineframedtext
  [framedcode]
  [strut=yes,
   offset=2mm,
   width=7cm,
   align=right]

\definetyping[code][numbering=line,
                    bodyfont=small,
                    before={\startframedcode},
                    after={\stopframedcode}]

\setuplinenumbering[location=intext]
\startcode
This is the first line
This is a rather long line that is wrapped, so look how the line numbering is done
Another line

Last line after an empty line
\stopcode
\stoptext
