Something like this should do it [in simplest terms,
untested]:
(defun C:AMZP (/ clay celt cec); = AMZigzag Polyline [call it something else if you like]
(setq clay (getvar 'clayer) celt (getvar 'celtype) cec (getvar 'cecolor))
(setvar 'clayer "AM_4")
(setvar 'celtype "AMZIGZAG")
(setvar 'cecolor "BYLAYER")
(command "_.pline"); leave you in the command
(while (> (getvar 'cmdactive) 0) (command pause)); accept User inputs until command is ended, then:
(setvar 'clayer clay)
(setvar 'celtype celt)
(setvar 'cecolor cec)
)
That would set the Layer and current-entity Color and Linetype back to what they were when you called the command, not necessarily to Layer 0 and ByLayer and/or ByBlock as in your original code. But it could be altered to force them to specific settings, whether or not those were current when it was called -- that would eliminate the variables in the above code.
It requires that the Layer and the Linetype do already exist in the drawing, but it could be altered to find out, and do something about it if necessary.
Load that [do you know how?], then, in a Tool Palette item, put simply:
^C^CAMZP
but you also have the option to just type in the command name AMZP [or whatever you call it], instead of being required to go to the Tool Palette for it every time [another advantage of defining a command name like this].
[I do wonder why you're assigning an override linetype, rather than assigning that linetype to the AM_4 Layer and using ByLayer.]