USERNAME would be replaced with the intended user whose status is being checked. placeholder text would be replaced with some sort of error message or notice that the script didn't run. It's recommended that the above code be put into a template for easier use.
Notes
The script can't know in real time whether you're online or not. What it does is the following:
It turns green (online) if you've made an edit in the last 60 minutes.
It turns orange (busy) if you've made 10 or more edits in the last 60 minutes.
If none of the above is true, it is red (offline).