When the viewport was created from other objects (polyline, circle or ellipse) it is associated to those other objects with reactors. You may be changing the color of the viewport, but from my experiences, the other object is always shown on top. If you use code like this to select the viewport, then it will give all the information for all objects under the selection box.
(setq ss (ssget "+.:E:s" '((0 . "VIEWPORT,*POLYLINE,CIRCLE,ELLIPSE"))))
Then you can test to make sure the the other objects beside the viewport has a viewport associated with it, and change that color also.
Here is the code for a polyline that was converted into a viewport.
(-1 . <Entity name: 7ef6fda0>)
(0 . "LWPOLYLINE")
(5 . "34")
(102 . "{ACAD_REACTORS")
(330 . <Entity name: 7ef6fdb0>)
(102 . "}")
(330 . <Entity name: 7ef6fce8>)
(100 . "AcDbEntity")
(67 . 1)
(410 . "Layout1")
(8 . "0")
(100 . "AcDbPolyline")
(90 . 4)
(70 . 1)
(43 . 0.0)
(38 . 0.0)
(39 . 0.0)
(10 8.91346 8.29392)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(10 3.04838 8.68737)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(10 2.48881 2.22642)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(10 9.32796 2.16429)
(40 . 0.0)
(41 . 0.0)
(42 . 0.0)
(210 0.0 0.0 1.0)
Notice that code 102 has a reactor. That is the viewport itself, code 330. This way you know that you selected the polyline that is associated witha a viewport. Now you would change the color of that object also.
Hope that helps.
Tim