Can I add instant yeast to sourdough dough that is not very active? I have a sourdough starter (rye flour based) that is quite active and I use it a lot.

I decided to make bread today and used AP flour instead of bread flour on purpose. I wanted to see what would happen. Turns out, not much is happening and the dough is not very active and not rising much. I wanted to bake it in a few hours. Assuming it doesn't pick up the pace by then, can I add instant yeast to it to at least get some rise out of the bread? I don't really throw out all that flour and it smells sour so I think some flavor will be there.

Or am I better off leaving it overnight to give the starter more time to work on this dough?
Yes, you can add instant yeast to a sourdough.  However, the fact that you used AP vs bread flour should not have much to do with the fermentation activity.  The different flours have different protein contents, which impact gluten development. Certainly, allowing it to ferment overnight is an option, but if you are short on time you can use an instant yeast to speed things up.