Hi,
I am not sure there is any direct way to detect this and even afraid is not.
What you could check is some of pathPoints properties assuming the result with more or less accuracy.
For example:
If first pathPoint type is not "SMOOTH" ==> pen was used
so:
if (app.selection[0].paths[0].pathPoints[0].pointType != PointType.SMOOTH) alert ("probably drawn by pen");else alert ("probably drawn by pencil")
Jarek