Set target angle in Guided_NoGPS using LUA Script

I did some modifications to the core flight controller and am trying to record (repeatable) step reponses (in roll and pitch) for the SingleCopter I built.
I tried putting the copter into Guided_NoGPS mode (as it has no gps) and sending angle targets using vehicle:set_target_angle_and_climbrate(…) depending on a switch position on the remote control using a simple LUA script. This does not seem to work. Any ideas how to make this work?