What are the positive and negative effects of insulin on cognitive function?
Diabetes

I've not read about any conclusive evidence for a link between insulin and differential cognitive function, but I have read studies that link type-2 diabetes and impaired cognition (1). I will point out now that this is cross-sectional, so the study only reports associations (i.e. diabetes may not necessarily cause the cognitive impairment).

The study I have mentioned does not conclude that this is caused by raised insulin, but rather the effects on the vascular system (specifically microvascular). They also find a significant interaction between diabetes and smoking status, in the context of cognitive impairment. Again, this seems likely to be the vascular system, rather than insulin levels.

A recent review paper also refers to the links between diabetes and executive function (2), but again makes no reference to insulin as the cause, but rather microvascular changes, hypertension, and other associated traits (again, the causes are not known, these are speculative based on the evidence).

Diabetes may not be the best model for studying this though, as it can be characterized by either high insulin (tolerance), or low insulin (impairment) - therefore the association may not be found this way.

Insulin

In a separate review (this may be the best one for you if you only read one of the papers I've referenced) the author posits that whilst insulin may have a neuroprotective role, it also increases amyloid-Beta metabolism and tau phosphorylation, possibly contributing to Alzheimer's-like pathologies (3). Studies have found that insulin directly improves cognitive performance (4) after infusion of insulin, but the long term effects are less certain - it is unlikely to improve overall health having constantly raised insulin serum levels!

However the link between IGF-1 and improved cognition is less disputed, so you may well be right in thinking that the 'overall' effect of insulin on cognition may be protective, but this may just be a marker of good health overall, which is certainly protective!