The former case definitely should work. Any problems with it are due to logical rather than syntactic errors (that is, it is acting as it should, but you are expecting it to act differently).
The issue with the latter case is that forEach always returns nil, so it isn't appropriate to be used directly in a condition. Instead, try:
({_x distance player < 5} count (nearestObjects [vehicle player, ["MAN"], 50])) > 0
What this does is count how many men are close to the player, and the condition is true if one or more of them are. However, it is a lot simpler once you get more complex scripts, just to run them in files, not in triggers themselves, since they are designed for simple functionality.
Your script is also different to the action of a trigger, since it will say "hello" once for each person near the player and once every second in this case. A trigger version would say "hello" when someone approached, but not say it again until the player was on his own again and then someone new approached.