You could do it like this:

```
   val newVal = if (isVar) {
     val fieldSym = NoSymbol.newValue(valName, newFlags = Flags.MUTABLE)
     val varDef = mkValDef(valName, returnStatement, returnType, NoMods withPosition (Tokens.VAR, NoPosition))
     varDef setSymbol fieldSym
   } else {
     val fieldSym = NoSymbol.newValue(valName)
     mkValDef(valName, returnStatement, returnType) setSymbol fieldSym
   }
```
and also change the mkValDef method to take the Modifiers, e.g. like this:
```
-  def mkValDef(name: String, rhs: Tree, tpt: TypeTree = new TypeTree): ValDef = {
+  def mkValDef(name: String, rhs: Tree, tpt: TypeTree = new TypeTree, mods: Modifiers = NoMods): ValDef = {
 
-    def valDef = ValDef(NoMods, newTermName(name), tpt, rhs)
-    def valDefForFunction = ValDef(NoMods, newTermName(name), tpt, Apply(rhs, Ident(nme.USCOREkw) :: Nil))
+    def valDef = ValDef(mods, newTermName(name), tpt, rhs)
+    def valDefForFunction = ValDef(mods, newTermName(name), tpt, Apply(rhs, Ident(nme.USCOREkw) :: Nil))
```
or even better, create a method similar to mkValDef and put it into the TreeFactory.