Phil's refueling script is pretty advanced, would take some to modify this for use in other locomotives I would guess. There was a basic fuel script around here some time ago but I don't think many creators picked up on it.
I did keep a copy of the script on one of my other systems that I use, it had the script file and what was needed to be added to the config.txt file to get everything to work correctly. If my memory is right, you needed to add the script and class lines and the queues table to the config.txt file, include the script file with it.