I would change some terminology -- you're using "statement" for some distinguishable categories of things [functions vs. arguments]. See interspersed things:
1. Defines the function's alias and variables( I'm trying to deduce what each variable corelates to.)
Not an alias, but the command name per se [an alias is like L giving you the LINE command without entering all of it.]
....
3. Sets the PEDITACCEPT value to 1. so that in the PEDIT command later, the question will not be asked whether to convert Lines/Arcs [if there are any in the selection] to Polylines.
4.Starts an IF statement function by looking for the existence in the drawing of the definition of the desired block name. Usually "looking for a Block" would mean looking for an insertion of it, a Block reference, but that's not applicable here.
5. Starts the THEN statement argument to the (if) function. The (progn) function is a "wrapper" so that multiple operations together constitute one argument for the 'then' expression, which is what to do if the 'test' expression returns anything other than nil. See Help for (if) for what they call arguments testexpr, thenexpr and elseexpr.
6. An If statement function that within its 'test'-expression argument sets a variable to the selected objects.
7. States [starts?] a THEN statement argument -- what to do if the 'test' expression returns anything other than nil, in this case if any qualifying objects were selected.
8. Starts an IF statement function that within its 'test' expression pulls from the previous selection, but only pulls the Polylines from it, and then sets those selected Polylines to a variable which will be nil if there are no Polylines in the original selection.
....
11. This one is confusing, but it looks like you're taking the number of polylines and decreasing the value by one, and then setting that as the new value for the number of polylines. Then pulling the name of the objects, to then delete the new number of polylines from the selected objects. Am I on the right track?
It removes each Polyline from the original overall selection [putting them into their own variable does not remove them from the original]. When DIVIDE happens later, they will not exist, having been EXPLODEd, which would cause a problem stepping through that original selection to DIVIDE the Lines/Arcs in it. It takes away one at a time, counting down not the number of Polylines [that remains the same], but the index number used by (ssname) for the item within the selection of Polylines-only to be removed from the larger selection.
....
13. Does this command make the explode command work when the previous command runs multiple times?
For some reason, EXPLODE within a (command) function can EXPLODE only one object even if given a multiple-object selection, unless you do something to get around that. There are other ways to do it [Search for QAFLAGS], but preceding it with (initcommandversion) is probably the simplest.
....
15. Selects the exploded lines and/or Arcs from the polylines and assigns them to a variable.
....
18. Combines the Selected objects with the selected polylines and assigns them to a new variable.
The 's' is not a variable, really [and could be omitted from the localized-variables list at the top]. It's a stand-in within the (foreach) function for the items in the supplied list argument. So the (repeat) function below is applied to what's in the ss variable, and then to what's in the ssp variable.
19. Starts a REPEAT statement that pulls the number of objects from the previous variable item in the list represented by the 's' for this round, in this case what's in the ss variable first, then what's in ssp the second time around and sets that number to a new variable.
....
21. Takes the value associated to the number of selected objects and selected polylines and decreases that value, only to then assign the new value to the same variable. Then pulls the type of entity and assigns that to a new variable?
This is again stepping through what's in the selection set represented by the 's' [ss the first time through, ssp the second], incrementing the index number downward to get each object in succession.
22. Pulls the length/distance from the two end points of a line and assigns that to a variable.
This parameter-based way can get the length from any of the different vlax-curve-class entity types, and is a common way when more than one type could be involved. It's universal, better than pulling VLA object-length properties, because those have different names [for a Line, it's called Length, for an Arc, it's called ArcLength, for a Circle, it's called Circumference]. And it's better than a way one might be tempted to use, namely to get the distance along the object at its end, with (vlax-curve-getDistAtPoint entityname (vlax-curve-getEndPoint entityname), because for a Circle or a closed Polyline [where the end is at the same place as the start], that will return zero.
....
26. End of the FOREACH statement. I don't quite understand this function. Can you explain?
FOR EACH item that the stand-in 's' represents in the supplied list argument, do as instructed. In this case, for the ss variable [first thing in the list], do the (repeat) function that DIVIDEs everything in that selection set, then for the ssp variable, do the same.
....
31. starts a PROMPT function that displays an error message regarding the block not being found.
The 'else' argument to the top-most (if) function -- what to do if its 'test' expression returns nil, i.e. if the Block name is not defined in the drawing.
....
31. Clears command bar. Typically referred to as "exiting quietly" so you don't have nil appear at the Command line. It can also be (prin1) [which is the function whose Help entry actually describes this as exiting quietly] or (print), in all cases with no arguments.
....