I wanted to be able to call a custom script to display additional information for a host in a screen as a URL item, so I wrote this patch that makes SCREEN_RESOURCE_URL dynamic.
If a URL item is marked as dynamic, the URL will be extended with hostid=[selected host's hostid]. (Probably it shouldn't be "hostid" but "zbx_hostid" or something to avoid messing other stuff up, but I think if one knows how to write a custom script, they can change that themselves..)
The URL itself may contain query strings (i.e. foo.php?bar=true&waz=false will work as well as foo.php, they will be extended with &hostid=[ID] or ?hostid=[ID] respectively).