This script lets you use the tag <custom target: smart heal> for enemy healing abilities, causing them to intelligently heal low-health allies instead of full health allies. Will do nothing as to when the enemy chooses to heal, though (i.e. will not change their AI patterns for choosing a skill to use).
This CAN be used for player spells; just use "random ally" for the scope in the database. It's reactive, so it'll base the heal on who's low upon casting (not at the start of the round).
Requires Yanfly Engine Ace Lunatic Targeting. Place it underneath.