Yes, assuming you don’t turn off the device in between (parameters are reset to the defaults when the device turns on).
The range per sample is determined by the sample_period, so the total range is determined by sample_period and number_of_samples, together with the speed of sound in the water you’re operating in (see here if you want to estimate it from vehicle data, and here for estimating salinity).
If you transmitAngle(40) and then transmitAngle(0) it will go the shortest direction back to the target angle (0 in this case), and it won’t transmit or take samples until it gets to the target angle. If you want you can test that by sending transmitAngle requests for 40, then 0, then 200 - it will take longer to get from 0 to 200 than from 40 to 0.