Selection of one solid and assignment of a material

I've been trying to write a journal that you can select one solid body in an assembly and you assign the material

I would suggest starting with the journal recorder. Record a journal while you assign a material and see what code is returned. Once you know how to assign the material, you can expand the journal by applying the material to a user-chosen body.