Warming up your car for more than 5 minutes while not being near or in it, is illegal in the state of Massachusetts since it's not a law regulated by any towns. Now it doesn't mean a police officer is driving around looking for idling vehicles because who has time for that honestly? It mainly has to do with the fact that you're putting yourself at risk of someone stealing your car or the exhaust possibly entering your home which causes carbon monoxide.
According to mass.gov, while this law does prohibit unnecessary idling, it also recognizes that there are times when idling is simply unavoidable and lists three specific exemptions: Like when an engine is being repaired and operating the engine is necessary for the repair; or when a vehicle is making deliveries and associated power is necessary; and when the engine is used to provide power to another device.
According to mass.gov, while this law does prohibit unnecessary idling, it also recognizes that there are times when idling is simply unavoidable and lists three specific exemptions: Like when an engine is being repaired and operating the engine is necessary for the repair; or when a vehicle is making deliveries and associated power is necessary; and when the engine is used to provide power to another device.