For entrance into STOP and WAIT mode you should use directly CPU instructions.
You can use for example:
asm STOP; //STOP mode
asm WAI; //force the MCU into wait mode
In case of STOP mode, there is necessary also clear S bit in CCR register prior you use STOP instruction, otherwise STOP instruction will be executed as NOP.
So, you can use this code:
asm ANDCC #0x7F; //clear S bit - enable the stop mode. If the S bit is not
//cleared then STOP instruction has no effect and is
//executed as a dummy instruction NOP.
asm STOP; //STOP mode
Note: S bit will be restored during next reset.