If the shapefile is of polygon type, the procedure is simple because its need was anticipated by the GIS designers:
Set the analysis environment parameters to match those of the current grid.
Convert the shapefile to a grid. This gives every cell within the polygon(s) some numerical value and every cell outside the polygon(s) has a NoData value.
Recalculate the values. There are many ways; one of the simplest is to check whether the cells are NoData or not:
Con(IsNull("My grid"), -999, 1)
(This is a "map algebra" command that can be issued in the Raster Calculator, in a tool, or within a Python wrapper.)
If the shapefile is of polyline type--which, from the description, it may be--then you need to convert it to polygon type. I believe an ArcInfo license may come with a tool for that conversion, but I also believe the base ArcMap product does not enable that tool. Nevertheless, the conversion to polygon can be accomplished with map algebra. Begin as before by setting the analysis environment and converting the shapefile to a grid. Now, the grid has numerical values only along the polyline: that is, along the polygon's boundary. To identify the interior,
Convert all NoData values to numeric values. Here, I chose 0:
Con(IsNull("My grid"), 0, 1)
RegionGroup the result. This identifies the inside(s) of the polygon(s), their boundaries, and the common exterior. Call this grid "RG", say.
Note the identifier assigned to the common exterior by RegionGroup. As in the first solution, convert its values to -999 and all other values to 1. For instance, if the identifier of the exterior is 53, use
Con([RG]==53, -999, 1)
It's a little disconcerting to involve a manual operation in what ought to be an automated workflow. However, a general solution requires some kind of user intervention, because the exterior of a closed polyline relative to a given grid extent is, in general, not uniquely defined. All we know is that the closed polygon divides that extent into two or more components, one of which we will elect to call its exterior. For example, this is a picture of a grid formed from a closed polyline feature. However, the grid's extent did not fully cover the extent of the feature:
Where is the exterior of this polygon? If you're having trouble telling, what do you think are the prospects that we could program an algorithm to find the exterior?
Here is a fuller picture of the situation. It reveals that the polyline is indeed the boundary of a multi-polygon feature.
The gray square shows the grid extent.