You're most welcome!
Prior to evaluating the PEDIT command I assign the last primary entity in the drawing database to the symbol ent using the entlast function. Then, after calling the PEDIT command, I test whether the value held by the symbol ent points to the same entity as that returned by entlast (and I redefine the ent symbol at the same time).
If the entity is the same, this indicates that the PEDIT command has not added any entities to the drawing database and has hence failed to generate a new polyline; as such, the test expression for the if statement is only validated if these entities differ with the new entity assigned to ent being the new polyline generated by the PEDIT command.