Enabling Scope-Based Interactions in Sensor Network Macroprogramming