Just bumping this thread as I would also like to know if there is some way to get the current script name dynamically.
Something like the PHP magic constant
__FILE__ or
$_SERVER["SCRIPT_FILENAME"]
Is there anything like this in RouterOS scripting or can it be determined in some way?