A few comments
X is the shortcut for Explode I always type a shortcut like this to see if it exists. Use say "XX" & "YY".
I would use '"Layer" "M" as it makes the layer if it does not exist, also sets it current.
Use Comand-s for the xline it will ask for more details or just make your command correct by completing the requests when running XLINE.
(command "xline" "H" (getpoint "\nPick point...