When I use
(command "_pline")
(while (> (getvar 'CmdActive) 0) (command pause))
...some code
everything goes OK, but when I do it with a "_-text" or "_text" or "_-hatch" instead of "_pline", these commands begin to skip some values and do not work properly, for example I can't write a text after setting insertion point for text, and can't select a method for hatching. Is there any other way to fix it, maybe i missed something?