OK, but now you are writing to memory you don't own.
char *command_script;is just thing that can hold a pointer. Right now it's blank (or some random garbage) so it's pointing at nothing in particular. You might get away with it just working, by not overwriting anything important, but one day it will cause a crash.
You need to initialise it to something, something big enough to hold your longest command strings, like this:
char *command_script = new char [50];
That will point it at 50 characters, but you have to remember to free it up at the end, like this
delete [] command_script;
You could instead declare
char command_script[50];
which gives you 50 chars of space (initially filled with garbage).
New problem: You've used = instead of == in the new code.
if ( execute=1 )
is always true, because it's an assignment. It puts the value 1 into execute and then does if (1) which is always true.
You want
if ( execute==1 )
When are you updating command_index? Seems it will always be 0.
This is always true too
if ( command_script[0]='W' && command_script[1]='A' && command_script[2]='I' && command_script[3]='T' )
should be
if ( command_script[0]=='W' && command_script[1]=='A' && command_script[2]=='I' && command_script[3]=='T' )
This is long winded way of checking for strings though. If you can arrange for command_script[4] to be 0 (perhaps when you see the ']' character you could stick it on the end then) then instead you can use
if (strcmp(command_script, "WAIT")==0)
You need #include <string.h> to use that.
Jim