Andrea, pay attention...
The line that you have
(command "_dim1")
puts Autocad into Dim mode and waits for a command. You are not supplying a command.
You need to have something else, either end dim mode by pressing enter such as
(command "_dim1" "")
or whatever it is that you want to do while in dim mode.
Now, the only reason I can see that you are not getting what we are trying to say is that you want to have Autocad change those settings (what you did before the (command...) bit), then you want to be able to do whatever, and then you want Autocad to change your settings back when you're finished. If that is the case, and the whatever part is going to be different each time you run it, then you either need to buy the "clairvoyency" module for Autocad or you need to use a reactor.
[EDIT: And I moved your thread into the appropriate forum and deleted the duplicate you setup.]