One way to get this done would be having a "while" loop that runs if the enemy is next to the player, this script would have to check all cardinal directions and select a target in the vicinity, you have the likes of "player.front_tile" to reference those tiles, and you can use something like this.
$mob_to_attack = $player.right_tile.characters.pop_front();
This will give you the first character on the right tile.
Anyhow there is several ways to approach this and I'd like to ask what is your main combat loop? does it happen in the overworld? is it real time? rouge like? tick based?
For the collision script is necessary for both to be on the same tile.
Best regards from the Worlak team.