This is a continuation of
this topic.
HasanCAD, your code is quite peculiar.
Example: you first use the CONVERTPOLY command and then explode all polylines...
To answer your first question:
To avoid skipping entities change line 31 to:
(setq ss (ssget ...))
Regarding your second question:
I am sure that if you search the forum you will be able to answer that question yourself.