The PlayerSay hook I would personally stick in the /lua/autorun folder of your server. Not entirely sure if there's any where else to put it.
As for the for loop I have there can just be stuck in the code of a command your making.
For example:
function hi()
for _, v in ipairs( player.GetAll() ) do
v:PrintMessage( HUD_PRINTTALK, "Hi" )
end
end
Of course I almost forgot that ULX had a thing for this (

) but there's a little handy function called ULib.tsayColor that you can use for fancier echos.
ULib.tsayColor( calling_ply, Color( 255, 0, 0 ), ply:Nick() .. Color( x, x, x ) .. msg, affected_plys ) --I used a bunch of x's because I forgot the RGB color combo for default gmod text.