Asriel does what he does because, with Chara's fusion, he inherited the player character's ability to save and load. This allowed them to behave in ways only possible for a "Player," such as making choices and going back on them by saving and loading. This is what they did for fun for an un-knowable amount of time.
In a neutral playthtough, likely a first-run where a player is likely to have killed a few monsters, Flowey makes some calls on what kind of "true end" you're going for and gives you pointers to achieve that end. (this is an assumption based on my own experience.) It's safe to say he's playing around with you, letting you be challenged, in turn giving him something to look forward to. He's been there for a long time, and you're the most interesting thing to happen in a long time.
In a pacifist playthrough, he doesn't want you to win, because not only will everyone else leave, but there won't be much else for you, the player to do either. You'll leave and maybe never come back. This is a very meta motivation for a villain, but anyone who's both killed and spared Toriel knows that's part of what he is.
In a no mercy play, though, he has second thoughts about assisting you, because you are ending all encounters with death. You are done with the game when everyone else is done being an obstacle. This is where Chara calls you out on the desire for GAINS *flex* like most other RPGS work to let you crush foes. In this scenario, there is little anyone, let alone Flowey/Asriel, can do to keep you invested in the game, since by the time you see him again you've already bested the "secret" boss, Sans.
tl;dr, Asriel is the manifestation of the game wanting you to keep playing the game. I would have said he's the game creator's self-insertion, but I think he's already confirmed that he's the dog that shows up randomly to fuck with you and the other characters.
welcome. everything I write here is something I felt to be important to some degree; game reviews, life updates/vents, and philosophical musings. I do my best to make my statements truthful. everyone is welcome to post comments, provided they are relevant.