I don't think a spy detector is a good enough upgrade for the engineer. Simply knowing that there is a spy around doesn't really help.
*Detector goes off* Boys theres a spy arou-SPY SAPPIN' MAH SENTRY *rest of the team follows up directly behind the sap as an organized team does and proceeds to decimate nest*
It needs be something that serves a purpose to specifically stop a spy from doing what it what usually does, and that is sapping. Like the Razorback, perhaps the ability to upgrade one device to level 4 which does nothing except provide a small second lifebar (visually, perhaps the form of an external battery) for the machinery, which must first be destroyed before the machine itself can be sapped. When the battery is being sapped, the machine still functions as normal, and is immune to being sapped until the battery is destroyed.
Concerning methods apart from sapping to destroy machinery, the external battery has no benefit, as an explosion would logically hit the entire object, and not be centered on the battery.
As a drawback to being able to do this, spies who constantly push and seek out nests rather than sitting around doing nothing waiting for the right moment should be rewarded in the face of this opposition. Apart from the 1 battery limit, engineers who choose to carry this extra power source require a different set of tools to install it. This "wrench" has the drawback of decreasing the max amount of metal that can be held, increasing the number of trips that must be made for the engineer to fully upgrade his devices on their own without punishing them in a team environment. Also, while other engineers may help build the machine to level 3, only an engineer with the special "wrench" can upgrade a device to level 4 and cannot be aided by normal wrenched engineers at the 4th level.
Further Drawbacks to be Considered:
To continue with this theme of rewarding speed, the "wrench" also has the drawback of not being able to speed up production time by whacking at the machinery as it builds.
Instead of punishing speed, gear this more towards individual play and say that the machinery is just altogether too complex for the normal wrench and therefore by choosing to use the special "wrench", you make other engineers without the wrench unable to assist you in the repair or construction of your devices.
Summary-
Pros:
Prevents a spy from sappin' your sentry or other device of choice by providing a second lifebar that must first be removed before the device itself can be sapped.
Neutral:
Only an engineer actually holding the special "wrench" can upgrade an object to level 4. Friendly engineers can help upgrade the "wrench" owner's devices to level 3 as usual, but not to level 4.
Only 1 level 4 upgrade per engineer with this item.
Cons:
Decreases maximum metal held meaning more time must be spent seeking metal to build with.
Possible Cons:
No increased building speed by hitting when building.
No help allowed from other engineers in repairing, upgrading, or speeding up production.
No Crits.