Hello,
The folowing code creates or updates a class with all glyphs which share the same mark as the current glyph:
classDict = dict([(c.split(':',1)[0], c.split(':',1)[1].strip()) for c in fl.font.classes])
classDict['mark_%s' % fl.glyph.mark] = ' '.join([g.name for g in fl.font.glyphs if g.mark == fl.glyph.mark])
fl.font.classes = ['%s: %s' % (i[0], i[1]) for i in classDict.items()]
fl.UpdateFont(fl.ifont)