For what it's worth, that's also what I do. But is it optimal? :)
The source code is leading the blog posts [1], so I think I already have an answer to that question for games on 2x2 and 3x3 boards using Markov Decision Processes, but the approach doesn't scale to the 4x4 board.
1) Swipe left until nothing else moves
2) Swipe down until nothing else moves
3) (If an empty space) Swipe up once
4) Repeat from 1.
There will only be a few times that you have to stop this process to get "unstuck".