Wow, that's an interesting question, as I've been testing a few things and they are all messed up:
set %c #charid
set %h . #charid , gg fart
set %hh %h . #charid , gg
set %i . %c , gg fart2
set %ii %i . %c , gg
set %3 #charid
halt
returns with the following variables:
%3: LMNOP
%C: LMNOP
%HH: N/Agg
%HILMNOPGG: fart
%II: N/Agg
%IILMNOPGG: fart2
It's almost like you can't access the %h . #charid , gg variable unless you can hardcode #charid into the name, although the following does work, as expected, since I use similar code in a number of my scripts (%jj is set to fart):
set %j . #charid fart
set %jj %j . #charid