You won't get banned if you're just using it to idle, but if you want to be super-duper safe you can use the steam_appid.txt trick instead, which involves making said text file in the root directory of a game's executable, inputting your desired app id (easiest way of obtaining this is to just load up your badge page and copy/paste the URL, being sure to remove everything but the number) and saving the file, then running the executable
from within the directory (this is particularly important as running the game through Steam itself will override the value in the text file).
Here's an example image featuring Age 2 HD. The neat thing about using this track in lieu of SAM is that you can be idling in one game while in fact being in another and there'll be no drop time penalty because as far as Steam is concerned you're in just the one game.