Interesting to speculate.
IIRC, he announced the ban on transgender recruits in a tweet. And IIRC, the Pentagon did not acknowledge the tweet as an order, and awaited a formal command from the Administration. The courts, on the other hand, have used Mr. Trump's twitter statements as evidence of his intent when evaluating the constitutionality of his various bans on travel from certain countries. Intent is personal, of course, but it is being evaluated as the intent of the President of the United States in his official capacity.
Brief digression, seeing as one poster wrote that Mr. Trump is in early senile dementia. I don't know about that.
I saw "The Dresser" recently. In a special feature on the DVD, Anthony Hopkins mentioned the way he played the character of Sir: he saw a man who had limited understanding of how to live in the mundane, because he was a man with only a life on stage. He had no interior life. Perhaps Mr. Trump is similarly unmoored in reality. He lies without shame, believes whatever is convenient to him, and breaks promises without remorse. Perhaps he has no interior sense of what is right, or what is true.
If he believes there is no unalterable truth, then a good liar -- say, not just an ex-KGB agent but an ex-KGB director -- could skilfully convince Mr. Trump that black is white, as long as it seems advantageous in the moment for Mr. Trump to believe in the whiteness of black... or believe that the very savvy, very controlling leader of Russia would actually not know about the well-documented Russian use of social media to influence American society. And of course a leader who does not believe that there is truth and there are lies, and who is not able or willing to hold to truth when the lies are advantageous to believe -- well, that leader is a danger to whomever he leads.
Believing untruth does not lead to good decision-making. A friend described riding along with his brother, who told him "I've found I can tell when there's an oncoming car even when it's out of sight. I can pass on a curve in perfect safety, don't worry." That's decision-making unmoored from reality.
Guessing about Mr. Trump's psychology is amusing, but really, who knows what's inside his mind?
Whether his tweets are official communications or not, they do reveal a petty, vindictive, and deeply narcissistic individual.