Contextual glyph insertion

Can you post some sample pics? I’m not sure I understand what you mean by ‘bar’ and ‘at a higher and a lower position’. higher/lower position towards the left side (previous glyph) or the right side (next glyph) or both?

Generally, you cannot ‘insert’ glyphs. You can only substitute a sequence with another. You may want to read an introduction to contextual substitutions.

Re first example: sub a b’ by a con_up_right; replaces the b (since it’s the marked glyph name), and the sequence a b will be turned into a a con_up_right. Is that what you want?

Re second example: If you replace a class like [a b], the replacement must be a class of the same size.