By definition, a variable stiffness spring is not linear (i.e. nonlinear).
The CGAP element is a bilinear stiffness spring - you define an open and closed stiffness on PGAP
In SOL 101, the element by default is treated as linear (only one of the stiffness values is selected based on the initial open/closed status and that stiffness is used for the duration of the solution). If you include a BCSET case control, the CGAP will be treated as contact and will essentially be compression only. See Including CGAP Elements in a Contact Solution in the online help.
In SOL 106, the CGAP is truly a nonlinear spring. The solution checks the open/closed status every increment and switches between the open/closed stiffness as required. This is exactly what you are asking for. If you have no other material nonliearities defines and PARAM, LGDISP is set to -1, the solution will essentially be linear except for the cgap iterations.
There are other nonlinear options as well. in SOL 401, CBUSH stiffness can be made nonlinear by providing KN values on PBUSHT. Again, a nonlinear solution is required, but if there are no other nonliearities defined, the only nonlinear aspect will be the PBUSHT.