I would check which key is being pressed to determine the direction player is attempting to move while colliding. If they're trying to move horizontally and player.y < floor(player.y/tileheight)+tileheight*0.5 then push player down(add to y position). If player.y > instead of < then subtract from y position.
Do similar adjustment for when player attempting to move in vertical direction.
I think something like that would be sufficient.