First of all: brep.IsSurface returns true if the brep is a single surface and is untrimmed.
Generally speaking, a brep is a surface if it only contains a single face, and a polysurface if it contains multiple. So you can use the length of obj.Faces to determine that part.
For trimming: If it’s a single surface, brep.IsSurface returns true if it’s untrimmed. If it’s a polysurface on the other hand you will have to iterate over all faces and check that each one of them is untrimmed (face.IsSurface).