Since the time "wait(1);" will wait depends on the hardware, you must time correct your counter. Otherwise the effect does depend on system speed too.
I encountered two more bugs in your code. It should be:
while(pain_stat == 1)
{
pain_panel.alpha = 100 - player._HEALTH * time;
wait(1);
}
and
while (drugged_working == 1)
{
camera.x += 10;
sleep(0.1);
camera.x -= 10;
sleep(0.1);
}
or
while (drugged_working == 1)
{
camera.x += 10*time;
wait(1);
camera.x -= 10*time;
wait(1);
}