Consider allowing one vertex $B$ to vary on your curve, with neighbouring vertices $A$ and $C$ fixed.  You want $B$ to be the point on the curve between $A$ and $C$ that maximizes total distance from $A$ and $C$.
The curves of constant total distance from $A$ and $C$ are ellipses with
foci at $A$ and $C$, so this total distance will be maximized at a point where your curve is tangent to one of those ellipses.  As is well known, a light ray from one focus of an ellipse reflected off the ellipse goes to the other focus.  If your curve is tangent to the ellipse at $B$, that means a light ray from $A$ will reflect off your curve at $B$ and go to $C$.

Standard methods of numerical optimization ought to work to find inscribed $n$-gons of maximum perimeter.  

Here's one for $n=7$ with an ellipse of major and minor axes $2$ and $1$, produced using Maple.

[![enter image description here][1]][1]


  [1]: https://i.sstatic.net/suJIl.png