The layout of the statement is wrong, it should be
Func CreatePath()
If FileExists("C:\test") Then
DirMove("C:\test", "C:\testnew", 1)
Else
DirCreate("C:\testnew")
EndIf
EndFunc ;==>CreatePath
or shorter if you want
Func CreatePath1()
If FileExists("C:\test") Then Return DirMove("C:\test", "C:\testnew", 1)
DirCreate("C:\testnew")
EndFunc ;==>CreatePath
There's also a colon missing from the file path in DirCreate in your post