When talking about "several scripts on one page", don't forget about visit_url() function.
If I understand correctly, KoLmafia calls relay script before executing request to KoL server. This is what visit_url() does. However, URL parameters still accessible to script.
Look at "disco combos"...