This is not legal advice. Please don't try to build one of these devices. I haven't researched this answer. But off the top of my head:
My guess is it's legal to have a phone that can be programmed to perform activities at specified times. You'd essentially just be making robo-calls/robo-texts, which lots of people do. For example, I get a lot of texts from political campaigns, and I wouldn't be surprised if these were written then scheduled to automatically go out at a certain time.
That being said, fabricating evidence is clearly a crime. So, I suspect that you could legally build and possess such a device, but could be guilty of a crime depending on how you use it. The same could be said of probably any non-contraband object.
Again, don't build one of these on my say-so. I'm just speculating.
As to the second part of your question--how the law would look at this kind of evidence in light of the possibility of fabricating it--that really depends on the jury. As it would play out in court, the party presenting the phone evidence would try to convince the jury that it's authentic, e.g. with expert testimony. Likewise, the other party could try to raise doubts as to its authenticity, perhaps by bringing expert witnesses of their own, who would testify about how easy it is to fake and such. And then it would be the jury's decision to give the evidence as much or as little weight as they see fit. So, there's no one-size-fits-all answer. It would depend entirely on the case each side makes and the whims of the jury.