Heck, I'd be mostly satisfied if "inside" actually meant inside in this case, not subterranean, and if pathing through outside tiles was actually impossible for the relevant dwarves, so that the entrance dance would be avoided. I cannot conceive of any reason why these two changes should be difficult at all.
The first would simply be a change of checking one flag instead of another, and would allow us to more easily choose which areas are safe or not (subterranean tiles cannot be created, only removed, while inside tiles can be both created and removed).
The second would simply add an extra check to the path finding algorithm, in the section where it checks to see if a tile is passable. The extra check would need to know if the creature doing the pathing is allowed outside, and whether the tile is inside or outside. If the creature is not allowed outside, but the tile is outside, then simply treat the tile as impassable, just as if the tile were occupied by a wall or something.
Although before calculating the path, if the creature doing the pathing is not allowed outside, then starting tile and ending tile would need to be checked as follows: If the ending tile is outside, then don't do the calculations, and just return that there is no path. If the ending tile is inside, then if the starting tile is outside, skip the above additional condition (just tell the pathing algorithm that the creature is allowed outside). All outside tiles should be passable like normal, as long as the destination is inside. If the starting tile is inside, then do the calculations with the above condition in place. This will allow the dwarf to run inside if it is currently outside, but will prevent it from grabbing additional jobs that are outside, and will never once let the dwarf step foot outside, if it is already inside and is trying to go somewhere else inside*.
The biggest remaining problem with this system would be a limit to flexibility, in that sometimes you might want a tile to be inside for one reason or another (perhaps you require it to be subterranean) but you still want it to be off limits. A completely user-defined system as suggested by everyone above would admittedly probably be the only way to achieve this flexibility. But it would also take significantly more programming, and would change the file format of the fortress.
*Well, that last part isn't exactly correct. If the dwarf is outside, and trying to path to an indoor location, it can cross over inside and outside tiles the whole way, passing back outside after it was inside. The correction to this would be to re-enable the above condition about impassable tiles the moment the pathing algorithm tries an inside tile. Once the dwarf steps inside, outside tiles become impassable. This might be undesirable, however, because while attempting to get inside, the dwarf might walk under a small structure (walkway, partial construction, whatever) which causes it to enter an inside tile. It would then be unable to leave that small inside area if all surrounding areas are outside, and the pathing algorithm would keep trying new paths until it either found one that remained completely outside until reaching the final inside area (which would be dumb), or found no paths at all, causing the dwarf to just stand around outside. So actually, it's probably best to simply not correct this aspect of the algorithm.