This AppleScript opens a page in Chrome (where you presumably have a logged-in session if required), opens the passed-in URL, runs the passed-in JavaScript and returns the JS return value.
Waits for 1 second for the page to load before executing the JS. Optionally, pass in a third argument with the number of seconds to wait.
Examples:
osascript js_in_chrome.scpt "http://google.com" "document.title"