Rob
Ansys Employee

Have you switched DDPM on? 

Indents are used to help work out where code blocks start and finish. Have a look at the UDF manual. Comments are also useful in case you're revisiting code in a few years.